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.

Error: could not find function ... in R

This is meant to be a FAQ question, so please be as complete as possible. The answer is a community …

r function error-handling r-faq
Calling a function every 60 seconds

Using setTimeout() it is possible to launch a function at a specified time: setTimeout(function, 60000); But what if I would …

javascript function timer setinterval
Difference between return and exit in Bash functions

What is the difference between the return and exit statement in Bash functions with respect to exit codes?

bash function return-value return exit
PHP append one array to another (not array_push or +)

How to append one array to another without comparing their keys? $a = array( 'a', 'b' ); $b = array( 'c', 'd' ); At …

php arrays function
How can I return two values from a function in Python?

I would like to return two values from a function in two separate variables. For example: def select_choice(): loop = 1 …

python list function return return-value
Is there a better way to do optional function parameters in JavaScript?

I've always handled optional parameters in JavaScript like this: function myFunc(requiredArg, optionalArg){ optionalArg = optionalArg || 'defaultValue'; // Do stuff } Is there …

javascript function arguments
Return value in a Bash function

I am working with a bash script and I want to execute a function to print a return value: function …

bash function return-value
Javascript call() & apply() vs bind()?

I already know that apply and call are similar functions which setthis (context of a function). The difference is with …

javascript arrays function
strdup() - what does it do in C?

What is the purpose of the strdup() function in C?

c function strdup