Variables are all global unless they are declared with the preface var .
All variables must be initialized before being read or modified. In JavaScript, variables have only a few possible types, and there is only very weak type checking when you use an assignment statement. No distinction is made between these subtypes for most purposes. In JavaScript 3.0, strings have been promoted to be objects, which makes the syntax govering their use more regular than it was in JavaScript 2.0. Strings can be initialized to any sequence of characters, including the empty string.