javascript-keywords

Difference between using var and not using var in JavaScript

What exactly is the function of the var keyword in Javascript, and what is the difference between: var someNumber = 2; var someFunction = function() { doSomething; } var someObject = { } var someObject.someProperty = 5; and: someNumber = 2; someFunction = function() { doSomething; } someObject = { } someObject.someProperty = 5; Whe...

What is the `name` keyword in JavaScript?

When I typed this apparently innocent snippet of code: values.name gedit highlighted name as a keyword. However, name is not listed by the pages linked to by an answer to a question about reserved keywords. I also did a couple trivial tests in SpiderMonkey, but name seemed to act like an ordinary identifier. A Google search didn't ...