JavaScript Functions

JavaScript Functions

By: Stephen Patrick | 13 Jul 2016 | Category: JavaScript Functions

JavaScript Functions

We can consider JavaScript as a functional language. In fact all functions in JavaScript are first class objects, and can be treated as such. Functions can be assigned to variables, passed to and returned from functions. Functions can also be defined as literals.

Read More

JavaScript Anonymous Functions

By: Stephen Patrick | 13 Jul 2016 | Category: JavaScript Functions

JavaScript Anonymous Functions

An anonymous function is a function without a name. Anonymous functions are useful in a number of scenarios. We can create them when needed such as passing them as a callback function to receive notification of a task. We can also assign them to a variable to be used later. For example, we can use an anonymous functions as a callback.

Read More

JavaScript Function Arguments

By: Stephen Patrick | 13 Jul 2016 | Category: JavaScript Functions

JavaScript Function Arguments

JavaScript allows to define functions that take no arguments. We can also define functions that take arguments. JavaScript allows us to pass values to functions as arguments. We can define our function to take arguments by placing one or more variables in the function definition parentheses.

Read More

JavaScript Scope

By: Stephen Patrick | 19 Jul 2016 | Category: JavaScript Functions

JavaScript Scope

Javascript allows us to define variables and functions. The location of where and how we define determines how that item can be used. Javascript has a global scope. Global scope is the top level or root scope any variable, function etc that is defined at global scope can be referenced, from a child scope or a variable at the same scope.

Read More

JavaScript Functions Are Objects

By: Stephen Patrick | 19 Jul 2016 | Category: JavaScript Functions

JavaScript Functions Are Objects

Functions in JavaScript are different to other programming languages such as Java. Functions in JavaScript are objects. In fact functions in JavaScript allow you to create new objects similar in some respects (but not the same) to classes in Java, C# etc.

Read More