Top "Function" questions

A function (also called a procedure, method, subroutine, or routine) is a portion of code intended to carry out a single, specific task.

How do JavaScript closures work?

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, …

javascript function variables scope closures
Set a default parameter value for a JavaScript function

I would like a JavaScript function to have optional arguments which I set a default on, which get used if …

javascript function parameters arguments default-parameters
Call a function from another file?

Set_up: I have a .py file for each function I need to use in a program. In this program, …

python file function import
Define global variable in a JavaScript function

Is it possible to define a global variable in a JavaScript function? I want use the trailimage variable (declared in …

javascript function variables scope declaration
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 …

javascript function syntax idioms
How to return a result from a VBA function

How do I return a result from a function? For example: Public Function test() As Integer return 1 End Function This …

excel vba function return return-value
Return array in a function

I have an array int arr[5] that is passed to a function fillarr(int arr[]): int fillarr(int arr[]) { for(...); …

c++ arrays pointers function return
What's the difference between a method and a function?

Can someone provide a simple explanation of methods vs. functions in OOP context?

function oop methods language-agnostic terminology
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.…

javascript performance function dynamic
Pass a JavaScript function as parameter

How do I pass a function as a parameter without the function executing in the "parent" function or using eval()? (…

javascript function parameters