javascript - Why is my function not working? -


Now that I have other questions, this function is not working. What is wrong?

  function myFunc () {return {obj = this; }; }   

JavaScript is not currently being functional because the semicolon is added automatically.

Your return statement is being read as Javascript:

  back; {Obj: this; };   

You must return { return :

 } to the same line) Obj: this; };   

In addition, objects should be {name: value} .

Comments