All Questions

7664
votes
88answers
1140492 views

How do JavaScript closures work?

A PHP Error was encountered

Severity: Notice

Message: Undefined index: body

Filename: views/Tagged_view.php

Line Number: 87

Backtrace:

File: /home/admin/web/allinonescript.com/public_html/application/views/Tagged_view.php
Line: 87
Function: _error_handler

File: /home/admin/web/allinonescript.com/public_html/application/controllers/Questions.php
Line: 158
Function: view

File: /home/admin/web/allinonescript.com/public_html/index.php
Line: 297
Function: require_once

5434
votes
29answers
804573 views

var functionName = function() {} vs function functionName() {}

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent. The previous developer uses two way...
337
votes
8answers
144804 views

How can I view the source code for a function?

I want to look at the source code for a function to see how it works. I know I can print a function by typing its name at the prompt: > t function (x) UseMethod("t") <bytecode: 0x2332948> &...
906
votes
8answers
107744 views
88
votes
13answers
67528 views

Why isn't the size of an array parameter the same as within main?

Why isn't the size of an array sent as a parameter the same as within main? #include <stdio.h> void PrintSize(int p_someArray[10]); int main () { int myArray[10]; printf("%d\n", sizeo...
1264
votes
28answers
477690 views

Difference between a method and a function

Can someone provide a simple explanation of methods vs. functions in OOP context?
42
votes
5answers
42798 views

Table name as a PostgreSQL function parameter

I want to pass a table name as a parameter in a Postgres function. I tried this code: CREATE OR REPLACE FUNCTION some_f(param character varying) RETURNS integer AS $$ BEGIN IF EXISTS (select...
2513
votes
19answers
580896 views

What is the difference between call and apply?

What is the difference between using call and apply to invoke a function? var func = function(){ alert('hello!'); }; func.apply(); vs func.call(); Are there performance differences between th...
194
votes
5answers
51909 views

Difference between method and function in Scala

I read Scala Functions (part of Another tour of Scala). In that post he stated: Methods and functions are not the same thing But he didn't explain anything about it. What was he trying to say?
123
votes
9answers
214392 views

Error: could not find function ... in R

I am using R and tried some.function but I got this error message : Error: could not find function `some.function` This question comes up very regularly. When you get the error: could not find func...

Previous Next