Is “var” optional?

myObj = 1;

same as ?

var myObj = 1;

I found they both work from my test, I assume var is optional. Is that right?

14 Answers
14

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *