Java vs JavaScript: an overview

Where JavaScript came from, why it is not a lighter Java, and why its versions are named after ECMAScript, such as ES6.

Novice · JavaScript · Updated

By

Java and JavaScript have a few things in common, but don't let the name fool you. JavaScript is NOT Java light. It is easy to think that because the languages share similar names that JavaScript was developed to be a light version of Java that runs in a browser. This is not the case.

In 1995, Brendan Eich, a developer at Netscape, developed a scripting language named Mocha to enhance the browser's capability to do more than just display static pages.

By this time, Java had emerged as a popular programming language. Netscape and Sun Microsystems partnered and re-branded Mocha with the new name of JavaScript. The two languages, however, are distinct from each other and serve different use cases.

In 1996, with the desire to standardize JavaScript across browsers, Netscape submitted JavaScript to the European Computer Manufacturers Association (ECMA).

In 1997, the first edition of the ECMAScript standard was published. While the popular name of the language is still JavaScript, the official name is ECMAScript, and the official versions are named using ECMAScript. For example the following 3 names all refer to the same version of "JavaScript": ECMAScript 2015 (for the year it was released), ECMAScript 6 (for the version number) or ES6 (for a short abbreviation).

Do it: print the three names of ES6

The snack stand's menu script is written for ES6. A new teammate reads the team's notes, finds three different names for that version, and asks whether the script needs three different versions of JavaScript. Answer with a first JavaScript program.

In JavaScript, console.log(...) prints one line, as System.out.println(...) does in Java.

The program prints exactly these three lines, in this order:

ECMAScript 2015
ECMAScript 6
ES6

Your job: write a program of three console.log lines.

  • The first line names the version by its year: ECMAScript 2015.
  • The second names it by its version number: ECMAScript 6.
  • The third is its short name: ES6.
  • Print nothing else.

Practiced live on the lesson page: write the JavaScript right there and check it.

Cheat sheets