Javascript 'colon' for labeling anonymous functions?
问题 What does this code refer too? queryString: function() { //some code } I tested it in the WebConsole (Firefox) but it wouldn't execute, so I'm thinking that it isn't equivalent to function queryString() {} . So what is it exactly? 回答1: You are missing some code there, but I assume its part of an object declaration like this: var obj = { queryString: function() { //some code } }; obj.queryString(); It assigns a function as a property of an object literal. It would be equivalent to this: var