by http://webgeektutorials.blogspot.com

Friday, September 5, 2014

Sencha Touch 2 - View and Controller Basics


Javascript: Introduction to Anonymous functions


Anonymous functions are functions that are dynamically declared at runtime that don’t have to be given a name.

Anonymous functions are declared using the function operator. You can use the function operator to create a new function wherever it’s valid to put an expression. For example you could declare a new function as a parameter to a function call or to assign a property of another object.

Example of a non-anonymous function:
function dosomething(){

    var b = 3;
    a += b;
    return a;
}