JavaScript function declaration -
Is the JavaScript code snippet function being declared? If no one, then they can give an overview of what they are?
some_func = function (value) {// some code here}
and
show: function (value ) {// some code here}
The first one is just making an anonymous function And specifying it on a some_func ()
.
The second object should be part of the node
var obj = {show: function (value) {// some code here}};
Then, the obj.show () will call the function
In both cases, you are creating an anonymous function. But in the first case, you are specifying it in only one variable. In the second case, while you are designating it as a member of an object (potentially many others).
Comments
Post a Comment