what does it mean when you set a function like this
setState: function(){
}
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 code is incomplete, but it looks like you’re assigning a function as the value to a property called
setStateof an object that isn’t shown in your code.An example:
Above, I’m creating a variable called
myObjectthat is an object with two properties,prop1andprop2. The first one is a string. If I writealert(myObject.prop1)it’ll alert “abc”.The second one is a function. If I write
myObject.prop2()I’ll execute that function, which’ll alert “def”.