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

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -