Language Basics JavaScript Tutorial

When the JavaScript sees a declared identifier (var varName), it creates a global variable.

var sTest = "hello ";
sTest2 = sTest + "world";
alert(sTest2);