The goal was to allow developers to enhance web pages with things like animated drop-down menus and validating form entries.
Initially called Mocha, it was to become a scripting language for the web – simple, dynamic, and accessible to non-developers.
A variable is a container for storing data values. For example:
var x = 5;
var y = 6;
var z = x + y;
X stores the value 5, y stores the value 6, and z stores the value 11.
In the example outlined in #2, the identifiers would be x, y, and z.