var - variables in JavaScript



examples/js/var.js
"use strict";

var user_name = 'Foo';
console.log(user_name); // "Foo"

var age = 42;
console.log(age);  // 42

age = 23;
console.log(age);  // 23

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

var email;
console.log(email); // undefined

email = 'foo@bar.com';
console.log(email);  // foo@bar.com