Skip to main content
All technologies
JavaScript logo

What is JavaScript?

JavaScript is the programming language of the web. Every major browser runs it, and Node.js runs it on servers.

Programming language. Updated by DATAL Projects

Made by
Brendan Eich at Netscape
First released
1995
License
Open standard (ECMAScript)
Type
Programming language
Runs on
Web browsers, Node.js, and other runtimes

What JavaScript is

JavaScript is the programming language of the web. Every major browser runs it, and Node.js runs it on servers. It powers interactivity on almost every website, so it works everywhere without installing anything.

JavaScript was created in 1995 by Brendan Eich while he worked at Netscape, the company behind an early popular web browser. It was written in a very short time so that web pages could respond to users. Despite the name, it is a different language from Java.

The language was standardized as ECMAScript by Ecma International in 1997, so every browser could follow the same rules. A large update in 2015, often called ES6 or ES2015, added classes, modules, arrow functions, and promises. The release of Node.js in 2009 let JavaScript run on servers as well as in browsers.

How JavaScript works

A web page is made of three parts. HTML gives it structure, CSS gives it style, and JavaScript gives it behavior. When a page loads, the browser reads the JavaScript and runs it with a built in program called a JavaScript engine.

JavaScript can read and change the page through the DOM, which is the browser's model of the page as a tree of elements. It listens for events such as clicks, key presses, and form submits, and runs functions in response. It can also request data from a server with the fetch function without reloading the page.

The language runs one thing at a time on a single main thread, and uses an event loop to handle waiting tasks. Slow work such as network requests is written as asynchronous code, using promises and the async and await keywords. Outside the browser, runtimes such as Node.js give JavaScript access to files, networks, and databases.

Key features of JavaScript

  • Runs in every browser

    All major browsers include a JavaScript engine. Visitors do not need to install anything.

  • Event driven

    Code reacts to user actions and other events. This suits interfaces, where most work happens in response to input.

  • Asynchronous by design

    Promises and async functions let a program wait for slow tasks without freezing the page.

  • Flexible typing

    Variables can hold any kind of value and types are checked while the program runs. This is quick to write but can hide mistakes.

  • Huge package ecosystem

    The npm registry holds a very large number of reusable packages for nearly any task.

  • Yearly language updates

    The standard is updated every year by a committee called TC39. New features are added without breaking old code.

When to use JavaScript

A good choice for

  • Adding interactivity to any website
  • Full web apps in the browser
  • Server code and APIs with Node.js
  • Beginners who want to see results quickly in a browser
  • Small automation scripts and browser extensions

Pick something else when

  • Heavy number crunching or data science, where Python has better tools
  • Large codebases without type checking, where TypeScript is safer
  • Low level or performance critical systems code
  • High end game engines, which use languages such as C++ or C#

JavaScript compared with alternatives

JavaScript vs TypeScript

TypeScript adds a type system on top of JavaScript and compiles back to it. JavaScript needs no build step and is simpler to start with. TypeScript catches more mistakes early and is preferred for larger projects.

JavaScript vs Python

Python is known for readable syntax and is strong in data work, scripting, and machine learning. JavaScript is the only language that runs natively in browsers. Many developers learn both and pick based on the job.

JavaScript vs Java

Java is a separate, statically typed language that is compiled and often used for large backend systems and Android apps. The two share part of a name for historical marketing reasons only. JavaScript is lighter to start with and is the language of web pages.

How to start learning JavaScript

  1. 01Learn basic HTML and CSS first so you have a page for your scripts to work on.
  2. 02Follow the JavaScript guide on MDN Web Docs at developer.mozilla.org, or the free tutorial at javascript.info.
  3. 03Practice in the browser console, which you can open with the developer tools in any browser.
  4. 04Build small projects such as a counter, a to-do list, and a quiz to practice the DOM and events.
  5. 05Learn fetch, promises, and async functions by showing data from a free public API on a page.

What JavaScript costs

JavaScript is free to use. It is an open standard, and the engines in browsers and runtimes such as Node.js are free as well. You only need a browser and a text editor to start.

How DATAL Projects uses JavaScript

JavaScript is part of our web development work in the Philippines. Common uses:

  • Interactive website features
  • Browser scripts and widgets
  • Server code with Node.js

Common questions about JavaScript

Is JavaScript free?

Yes. The language is an open standard and every browser runs it at no cost. The common tools around it are free and open source too.

What is JavaScript used for?

It is used to make web pages interactive, to build full web apps, and to write server code with Node.js. It is also used for desktop apps, mobile apps, and browser extensions.

Is JavaScript the same as Java?

No. They are two different languages with different designs and uses. The similar names come from a marketing decision in the 1990s.

Is JavaScript hard to learn?

It is one of the easier languages to start with, because you can run it in any browser and see results right away. Some parts, such as asynchronous code and the this keyword, take more time to understand.

Is JavaScript still worth learning?

Yes. It is the only programming language that all browsers run natively, so web development depends on it. Learning it also prepares you for TypeScript, React, and Node.js.

Need a project built with JavaScript?

Tell us what you need. We reply with a scope, a price, and a timeline.

Start a Project