Generally speaking, a function is a "subprogram" that can be called by code external (or internal in the case of recursion) to the function. Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function will return a value.
The arguments object is an Array-like object corresponding to the arguments passed to a function.
The arguments.length property contains the number of arguments passed to the function.
Default function parameters allow formal parameters to be initialized with default values if no value or undefined is passed.
The get syntax binds an object property to a function that will be called when that property is looked up.
The set syntax binds an object property to a function to be called when there is an attempt to set that property.
Expression closures are a shorthand function syntax for writing simple functions.
Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure—a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.
The initial value of the @@iterator property is the same function object as the initial value of the Array.prototype.values property.
The arguments.callee property contains the currently executing function.
The obsolete arguments.caller property used to provide the function that invoked the currently executing function. This property has been removed and no longer works.
An arrow function expression has a shorter syntax compared to function expressions and lexically binds the this value (does not bind its own thisargumentssuper, or new.target). Arrow functions are always anonymous. These function expressions are best suited for non-method functions and they can not be used as constructors.
Starting with ECMAScript 2015 (ES6), a shorter syntax for method definitions on objects initializers is introduced. It is a shorthand for a function assigned to the method's name.
The rest parameter syntax allows us to represent an indefinite number of arguments as an array.