I often see code like the following in JavaScript:
func1: function() {
return array1.pop();
}
What is the difference between the above and something like this:
function func1 (){
return array1.pop();
}
Are the above two the same thing with different way of writing? The first one looks like a switch statement to me. Sorry if this question is too simple but JavaScript books seldom uses the first syntax if this is just the matter of syntax issue; the main reason for me to ask this question in StackOverflow.