HTML and CSS Reference
In-Depth Information
JavaScript
JavaScript is the only language natively supported in virtually all web browsers in existence.
JavaScript first appeared in 1995 in an early version of the Netscape Navigator browser, and
quickly migrated to Internet Explorer. JavaScript is essential for adding dynamic and inter-
active features to a web application.
//
Although Microsoft continues to support VBScript, this has not been implemen-
ted in other browsers meaning it is not a viable option when creating Web Applic-
ations.
It is worth clearing up a small point regarding terminology first. JavaScript has been form-
alized in the ECMAScript language specification. When this topic refers to JavaScript, tech-
nically it is referring to ECMAScript version 5.
JavaScript was named after the programming language Java, but this was primarily to allow
JavaScript to piggyback off the name recognition of Java rather than any intrinsic similarity
between the languages.
JavaScript is in fact a very different language from Java, specifically:
• JavaScript supports dynamic typing as opposed to Java, which supports static typing. This
means you can declare a variable in JavaScript without declaring its type, which will only
be derived at run-time.
• JavaScript has first class functions. It is possible to assign a function to a variable or pass
it to another function as a parameter. This may sound like a small feature, but it leads to
an enormous number of possibilities, and allows software engineers to write software us-
ing functional programming techniques. These techniques will be discussed in detail in later
chapters.
• Although JavaScript supports classes, its implementation of classes is somewhat confus-
ing. This topic will recommend that you avoid classes as far as possible and utilize proto-
typing techniques to create objects.
This topic is not a tutorial on all features of the JavaScript language. Instead, this topic will
outline a set of fundamental approaches that software engineers can adopt with JavaScript.
Search WWH ::




Custom Search