About ECMAScript

Familiar syntax

ECMAScript's syntax is similar to other popular programming languages
such as Java and C. This means that many common
programming idioms look familiar in ECMAScript.

for(i =0; i < a.length; i++){if(a[i]==x)return i;}

Object-oriented programming

ECMAScript supports object-oriented programming. Objects in ECMAScript
are values with named properties. Object properties that are
functions can be called as methods.

window.setTitle(user.name);

Functions are objects, too!

ECMAScript functions are objects and can be stored as properties,
passed as arguments, and returned as results. This powerful
idiom from functional programming allows your functions and
methods to import functionality from their caller in a simple
and flexible way.