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 code . Then call the function using 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

Popular posts from this blog

Is there an open source WebSockets (JavaScript) XMPP library? -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

mysql - Can mysql_pconnect be called multiple times in one php page? -