June 2012
Intermediate to advanced
386 pages
10h 7m
English
Here are some of the ways that variables and functions can be declared.
var n = 1;
function f1() {} //function statement
(function f2() {}); //function expression
(function (f3) {} (param)); //function with parameter
At the outset it appears that functions in JavaScript are no different from functions in other programming contexts like C or C++ or Java. It is true that they are referred in the same context in the sense that a function is a block of code defined once but reused several times across. JavaScript also supports the concept of recursive functions. They are defined and invoked in much the same way as in other languages. However, there are stark differences in JavaScript which makes this language extremely ...
Read now
Unlock full access