Now that I have my other questions answered, this function isn’t working. What’s wrong?
Weird JavaScript statement, what does it mean?
How to handle click event in javascript?
function myFunc() {
return
{
obj = this;
};
}
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.
Your function is not working due to how JavaScript auto-adds semicolons.
Your
returnstatement is being read by JavaScript as:You need to put the
{on the same line asreturn:Also, objects need to be
{name: value}.