Skip to content
— CH. 1 · CREATION AND NAMING ORIGINS —

JavaScript

~4 min read · Ch. 1 of 6
6 sections
  • In 1995, Brendan Eich sat at a desk inside Netscape Communications Corp. and began writing code for what would become JavaScript. The company needed a language to add dynamic behavior to their web browser, which was then called Netscape Navigator. They initially considered embedding Java from Sun Microsystems or Scheme, but management decided on a new path. Eich created the language in just ten days during May of that year. When the beta version shipped in September 1995, it carried the name LiveScript. The official release arrived in December 1995 with a different title: JavaScript. This decision was not technical but marketing-driven. At the time, the dot-com boom had begun and Java was the popular new language. Netscape executives wanted to capitalize on that buzz by naming their creation after Java, even though the two languages were fundamentally distinct.

  • Microsoft entered the browser war in 1995 when they debuted Internet Explorer. By November 1996, Microsoft released JScript, its own interpreter for client-side scripting. Each implementation differed noticeably from Netscape Navigator, making it difficult for developers to ensure websites worked well across both browsers. Logos reading best viewed in Netscape appeared alongside best viewed in Internet Explorer for several years. In response to this fragmentation, Netscape submitted JavaScript to Ecma International in November 1996. This led to the first ECMAScript specification being released in June 1997. Subsequent versions followed, including ECMAScript 2 in June 1998 and ECMAScript 3 in December 1999. However, Microsoft gained dominance in the early 2000s, reaching 95% market share for Internet Explorer. This meant JScript became the de facto standard while the official standards process stalled. Microsoft eventually stopped collaborating on ECMA work, causing ECMAScript 4 to be mothballed entirely.

  • Client-side scripting stagnated during the period of Internet Explorer dominance until 2004. That year, Mozilla released Firefox, which took significant market share away from Internet Explorer. A pivotal moment arrived in 2005 when Jesse James Garrett published a white paper coining the term Ajax. He described technologies that allowed data to load in the background without full page reloads. This sparked a renaissance period spearheaded by open-source libraries like jQuery, Prototype, Dojo Toolkit, and MooTools. Google debuted Chrome in 2008 with the V8 JavaScript engine, introducing just-in-time compilation that forced other vendors to overhaul their engines. Disparate parties met at a conference in Oslo in July 2008. They reached an agreement in early 2009 to combine all relevant work and drive the language forward. The result was the ECMAScript 5 standard released in December 2009. Ambitious work continued for years, culminating in ECMAScript 6 published in 2015.

  • Node.js changed the landscape of JavaScript usage when Ryan Dahl created it in 2009. This runtime system combined the V8 engine, an event loop, and I/O APIs to provide standalone execution outside web browsers. By 2018, millions of developers used Node.js, and npm held the most modules of any package manager globally. Electron framework enabled desktop applications using JavaScript behavior, while Cordova and React Native extended reach further. Adobe Acrobat began supporting scripting PDF documents through JavaScript. GNOME Shell extensions also utilized JavaScript for functionality. Oracle previously provided Nashorn as part of Java Development Kit version 8 before removing it in JDK 15. GraalJS now serves as a replacement allowing runtime scripting within Java applications. Embedded systems increasingly leverage Node.js for lightweight execution environments.

  • JavaScript operates as a single-threaded language where the runtime processes messages from a queue one at a time. Each message creates a call stack frame containing function arguments and local variables. When the call stack empties upon function completion, JavaScript proceeds to the next message in the queue. This mechanism is called the event loop, described as run to completion because each message fully processes before consideration of the next. The concurrency model remains non-blocking since program I/O uses events and callback functions. A developer can process a mouse click while waiting for database query results. Dynamic typing means types associate with values rather than expressions. Variables initially bound to numbers may be reassigned to strings later. Prototypal inheritance allows objects to inherit properties directly from other objects without class-based structures. Functions serve as both executable code blocks and object constructors when prefixed with new.

  • Cross-site scripting represents a common vulnerability where attackers cause target websites to include malicious scripts presented to victims. These scripts access banking applications with victim privileges potentially disclosing secret information or transferring money without authorization. HTML sanitization offers an important solution to such vulnerabilities. Cross-site request forgery occurs when attacker site code tricks victim browsers into taking unintended actions like transferring funds. Requiring authentication tokens in hidden form fields helps prevent these attacks. Prototype pollution allows runtime overwriting of arbitrary properties within an object's prototype chain. Buffer overflow exploits in browser engines could grant operating system API access with superuser privileges. Major browsers including Firefox, Internet Explorer, and Safari have contained flaws exploitable via JavaScript. In 2015 researchers described rowhammer attack implementations using JavaScript. Spectre attacks against speculative execution included JavaScript implementations published in 2018. Browser sandbox implementation errors sometimes granted Web-originated code privileges intended only for trusted sources.

Continue Browsing

Common questions

When did Brendan Eich create JavaScript at Netscape Communications Corp?

Brendan Eich created JavaScript in just ten days during May of 1995. The language was initially named LiveScript when the beta version shipped in September 1995 before receiving its official title in December 1995.

Why did Netscape name their new language JavaScript instead of LiveScript?

Netscape executives chose to name the language JavaScript for marketing reasons rather than technical ones. They wanted to capitalize on the popularity of Java during the dot-com boom even though the two languages were fundamentally distinct.

What year did Ecma International release the first ECMAScript specification for JavaScript?

Ecma International released the first ECMAScript specification in June 1997 after Netscape submitted JavaScript to them in November 1996. Subsequent versions followed including ECMAScript 2 in June 1998 and ECMAScript 3 in December 1999.

How does Node.js enable standalone execution outside web browsers?

Ryan Dahl created Node.js in 2009 as a runtime system that combined the V8 engine with an event loop and I/O APIs. This architecture allows developers to run JavaScript code independently from web browsers using environments like Electron or embedded systems.

What is the concurrency model used by JavaScript called and how does it function?

JavaScript uses an event loop mechanism described as run to completion where the runtime processes messages from a queue one at a time. Each message creates a call stack frame containing function arguments and local variables before the next message is considered.