Page 317 - Webapplication11_C11_Flipbook
P. 317
Do You Know?
• The development of JavaScript took only ten days.
• The original name for JavaScript was Mocha.
• Semi colons are commonly used at the end of statements in several programming languages. Although
JavaScript does this, you may also use a semicolon at the start of a statement.
History of JavaScript
In the early days of the Internet, web pages could only be static and lacked the capacity to behave dynamically once
they were loaded in a browser. In 1995, Netscape Communications Corporation made the decision to incorporate
a scripting language into Navigator in response to the web developer community's demand to do away with this
restriction. In order to do this, they pursued two different strategies: working with Sun Microsystems to integrate the
Java programming language and employing Brendan Eich to integrate the Scheme language.
Before the development of JavaScript, there was no programming language to make websites dynamic. To add dynamism
to websites, Brendan Eich created JavaScript in 1995. JavaScript became an European Computer Manufacturers
Association (ECMA) standard in 1997, and subsequent work resulted in the standardized version named ECMAScript.
Initially, JavaScript was called LiveScript. JavaScript got its name from Netscape's support of Java applets within its browser.
The first edition of the ECMA-262 specification was published in June 1997 by ECMA International. The second edition
was published in June 1998, a year after some changes were made to conform to the ISO/IEC-16262 standard. The
most common edition of ecma-262 at the moment is the third edition. The fourth version of the ECMAScript standard
has not been published and is not used in everyday life. In December 2009, the ECMAScript standard's fifth edition was
made available. ECMAScript 5.1, which was released in June 2011, is the most recent edition.
JavaScript as an Interpreted Language
JavaScript is considered an interpreted language, which means it does not need to be compiled into machine code
before execution. Instead, an interpreter (in this case, the web browser) reads the JavaScript source code and executes
it directly, line by line.
Unlike compiled languages, where the entire program is first translated into machine code, JavaScript is executed
immediately by the browser. If an error occurs at any line during execution, the interpreter halts further execution of
the program at that point.
While interpreting the code line by line allows for easier debugging and immediate execution, it can also lead to slightly
slower performance compared to compiled languages, as the interpreter processes each instruction on the fly.
Features of JavaScript
JavaScript is one of the most popular languages and includes numerous features when it comes to web development.
Some important features of JavaScript are as follows:
Ð ÐLight Weight Scripting Language: JavaScript is a lightweight scripting language because it is made for data handling
at the browser only. Since it is not a general-purpose language so it has a limited set of libraries.
Ð ÐPlatform Independent: JavaScript is platform-independent, or portable, which simply means that you can write the
script once and run it anywhere at any time.
Ð ÐDynamically Typed Language: The JavaScript programming language supports “Dynamic Typing,” which means that
the variable types are determined by the stored value. For example, if you declare a variable named “x” you can
store any type of value in it, such as a string, array, or int. This is known as “Dynamic Typing.”
Ð ÐPrototype-based Language: JavaScript is a scripting language based on prototypes. This means that JavaScript uses
prototypes rather than classes or inheritance. In programming languages such as Java, we first create a class and
then objects for that class. However, in JavaScript, we define an object prototype and then use this object prototype
to create additional objects.
JavaScript Part 1 315

