Animations

API

Arrays

Async

Basics

Challenges

Classes

Console

Dates

Debugging

DOM Elements

DOM Methods

DOM Navigation

DOM Properties

Event Listeners

Flow Control

Forms

Functions

Global Functions

JSON

Keywords

Libraries (3rd party)

Math

Modules

Objects

Snippets

String

Types

Widgets

Window Object

JavaScript - Anonymous Functions

The function x below is an anonymous function. It is a function without a name. These functions are stored in variables and do not need function names. It's just a function...without a name...assigned to a variable. They are always invoked (called) using the variable name.


// anonymous examples
var x = function (a, b) {return a * b};
var z = x(4, 3);

// named example
var x = FunctionY(a, b);
function FunctionY(a, b)
{
    return a * b;
}