A precise and specific descriptions of this distinctive feature of JavaScript.
Function in JavaScript is defined as an object (dictionary) with code that is an immutable string property. This makes JavaScript unusual and powerful. It just looks similar to other languages.
Just JavaScript - The Function Object:
function definition:
var myFunction = new Function("a","b", "var ans=a+b; return ans;");
is equivalent to:
var myFunction = function(a,b) { var ans=a+b; return ans; }
and function expression:
function myFunction(a,b) { var ans=a+b; return ans; }
No comments:
Post a Comment