Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variable definition

// "use strict";

a = 1;
console.log(a); // 1

var b = 2;
console.log(b); // 2

var c;
console.log(c);         // undefined
console.log(typeof c);  // "undefined"

d = undefined;
console.log(d);         // undefined
console.log(typeof d);  // "undefined"

console.log(e);         // undefined
console.log(typeof e);  // "undefined"
var e = 3;


console.log(x); // ReferenceError: x is not defined