JavaScript [edit]

JavaScript (/ˈdʒɑːvəskrɪpt/), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. Over 97% of websites use JavaScript on the client side for web page behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

History [edit]

JavaScript was created in 1995 by Brendan Eich while he was an engineer at Netscape. It was originally developed under the name Mocha, then renamed to LiveScript, and finally to JavaScript when Netscape added support for Java technology in its Netscape Navigator web browser.

In 1996, Netscape submitted JavaScript to ECMA International to create a standard specification that all browser vendors could conform to. This led to the official release of the first ECMAScript language specification in 1997.

Features [edit]

JavaScript is a high-level, often just-in-time compiled language that conforms to the ECMAScript specification. It has dynamic typing, prototype-based object-orientation, and first-class functions. It is multi-paradigm, supporting event-driven, functional, and imperative programming styles.

  • Prototype-based: JavaScript uses prototypes instead of classes for inheritance.
  • First-class functions: Functions in JavaScript are first-class citizens, meaning they can be passed as arguments, returned from other functions, and assigned to variables.
  • Dynamic typing: Variable types are determined at runtime rather than at compile time.
  • Object-oriented: JavaScript follows object-oriented programming principles, though it uses prototypes instead of classes (prior to ES6).

Syntax [edit]

JavaScript's syntax is influenced by Java, but it has also been influenced by Awk, Perl, Python, and other programming languages.

Here is a simple example of JavaScript code:

function greet(name) {
    return "Hello, " + name + "!";
}

console.log(greet("World"));  // Outputs: Hello, World!
                

Usage [edit]

JavaScript is primarily used in web browsers to create dynamic and interactive user experiences. It can be used to:

  • Manipulate HTML and CSS
  • Handle user interactions such as clicks, scrolls, and form submissions
  • Make asynchronous HTTP requests
  • Animate elements on the page
  • Store data in the browser using cookies, localStorage, or IndexedDB

With the advent of Node.js in 2009, JavaScript has also become popular for server-side programming, allowing developers to use the same language on both the client and server sides.

Popular Frameworks [edit]

Several JavaScript frameworks and libraries have been developed to simplify and enhance web development:

  • React: A library for building user interfaces, developed by Facebook
  • Angular: A full-featured framework developed by Google
  • Vue.js: A progressive framework for building user interfaces
  • Express: A minimal and flexible Node.js web application framework
  • jQuery: A fast, small, and feature-rich JavaScript library

References [edit]

  1. Flanagan, David (2011). JavaScript: The Definitive Guide (6th ed.). O'Reilly Media.
  2. Crockford, Douglas (2008). JavaScript: The Good Parts. O'Reilly Media.
  3. Simpson, Kyle (2014). You Don't Know JS. O'Reilly Media.
  4. Haverbeke, Marijn (2018). Eloquent JavaScript (3rd ed.). No Starch Press.