JavaScript is a web programming language alongside HTML and CSS. It is widely used, with 98% of websites incorporating it. It is a high-level language with dynamic typing and supports multiple programming styles. Furthermore, it has APIs for various tasks and works with the Document Object Model (DOM). While it lacks built-in I/O, web browsers and runtime systems provide JavaScript APIs to handle such cases.
JavaScript engines are now even used in servers and applications, with Node.js being the most popular runtime system. Despite similar names, Java and JavaScript have distinct designs and differ significantly.
Influences
JS has many influences but the strong initial influence is Lisp and Scheme due to the popularity of Java, JavaScript needed to appear syntactically closer to Java to improve the adoption of JS.
- Java influenced JavaScript's syntax.
- Self-inspired JavaScript's prototype-based object-oriented programming model.
- Lisp and Scheme influenced JavaScript's functional programming concepts.
- Smalltalk influenced JavaScript's event-driven programming model.
- Haskell influenced JavaScript's built-in functional methods.
EcmaScript Vs JavaScript
ECMAScript is the standardised scripting language specification, defining the syntax, semantics, and behaviour. JavaScript is the implementation of ECMAScript. It extends the specification with browser-specific features like DOM manipulation and event handling. Other implementations include JScript and ActionScript.
Creation
In the early days of the web, Mosaic was a popular browser that led to the founding of Netscape. Netscape Navigator, a more advanced browser, was released in 1994 and gained widespread usage. To overcome the limitation of static web pages, Netscape sought to add a scripting language. They considered Java and Scheme but ultimately decided on a new language with Java-like syntax. It was created by Brendon Eich in just 10 days.
Initially named Mocha, then LiveScript, it was later rebranded as JavaScript upon its official release in December 1995. The choice of the name JavaScript caused confusion, as it was unrelated to Java and seen as a marketing tactic during the dot-com boom.
Javascript as we know was made in just a few weeks to not let other languages go on to become the leader of the browser ecosystem.
Browser Wars
In the browser war between Microsoft and Netscape, Microsoft introduced Internet Explorer in 1995 and developed its own JavaScript interpreter called JScript. JScript was released in 1996 with support for CSS and HTML extensions, but it differed significantly from Netscape's implementation, causing compatibility issues for developers.
In 1996, Netscape submitted JavaScript to ECMA International to establish a specification, leading to the release of the first ECMAScript language specification in 1997. Microsoft's dominance in the browser market made JScript the de facto standard for client-side scripting.
Growth
In the early 2000s, Internet Explorer dominated the browser market, causing stagnation in client-side scripting. However, in 2004, Mozilla's release of Firefox challenged Internet Explorer's dominance and gained significant market share. Mozilla joined ECMA International in 2005 and collaborated with Macromedia to standardize ActionScript 3 as the new ECMAScript 4.
Despite efforts, ECMAScript 4 did not materialize without Microsoft's cooperation. Meanwhile, open-source communities thrived, with the introduction of Ajax and JavaScript libraries like jQuery, Prototype, Dojo Toolkit, and MooTools. Google's Chrome browser, featuring the faster V8 JavaScript engine with just-in-time compilation, prompted other browser vendors to improve their engines. In 2009, a conference in Oslo brought various parties together, resulting in the release of the ECMAScript 5 standard in December 2009.
Dominance
ES6 was published in 2015, with years of ambitious work and introducing numerous additions and refinements. The introduction of Node.js in 2009 by Ryan Dahl expanded JavaScript's usage beyond web browsers, providing a standalone runtime system. Node.js, powered by the V8 engine, an event loop, and I/O APIs, gained popularity among millions of developers, with npm becoming the world's largest package manager.
The ECMAScript draft specification is now openly maintained on GitHub, with regular annual snapshots and a comprehensive proposal process for potential language revisions.