JavaScript is a functional scripting language that is mainly in use as a language for running client-side scripts in a web browser. It is also common in other applications outside of web pages including PDF documents and desktop widgets. The launch of faster JavaScript virtual machines has lead to an increase in the use in server-side web applications.

JavaScript has syntax similar to that of C and takes many of its conventions and names from Java, but it is different to either language. It is actually an implementation of the ECMAScript language that has borrowed the design principles of the Self and Scheme languages.

If you have come to JavaScript from a background in Java or C, then you will like the variation on the for loop. It is like the for loop in Perl, Python or PHP but with a little twist. You can use a for loop to repeatedly run a block of script, or once for [...]

One of the key concepts of JavaScript is the keyword, this, which signifies the JavaScript context object. If you write an inner function, you can access any local variables that you define in the outer function exactly as if you had defined them locally. You can also access any arguments that you pass to a [...]

It is possible to define multiple functions with the same name in JavaScript, and the last one of those that you define will be the one that runs. This is unlike other languages where you can distinguish between functions by using a different number of arguments when you call the function. Most programmers will only [...]

JavaScript allows the use of anonymous functions with full closures. Functions are objects and you can pass them as arguments just like any other object. The scope of a function includes all the names in the scope where it was declared. As you declare functions at run time and local variables can remain after the [...]

JavaScript has member functions for all objects, such as valueof and toString. When you use literal numbers, Booleans, strings, undefined and null are different from the counterparts that you use for objects. This example shows this: <br /> Typeof new Number(i); // Returns object<br /> Typeof I; // Returns number<br /> There are ways that [...]

The JavaScript Object is very versatile and useful. It works a little like the Object base type in Java and the associative array type like %hash from Perl, dict from Python or array from PHP, and is the best of both worlds. You can also use them for String to Object mapping. You can initialize [...]