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

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -