Javascript declare variable using "var"

Posted by codemeit on Stack Overflow See other posts from Stack Overflow or by codemeit
Published on 2010-03-21T01:06:51Z Indexed on 2010/03/21 1:11 UTC
Read the original article Hit count: 330

Filed under:

Is "var" optional?

myObj = 1;

same as ?

var myObj = 1;

I found they both work from my test, I assume var is optional?

© Stack Overflow or respective owner

Related posts about JavaScript