What’s the difference between:
pause: function () {
this.state.gamePaused = true;
},
and
function pause() {
this.state.gamePaused = true;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first example is probably part of an object, which means that pause is a function of an Javascript object and the second one pause as a stand alone function.
I’d expect to see the first example in something like:
And thus it is used like:
On the other hand, the second example would be used like: