Javascript related notes - wide view

From Helpful
Jump to: navigation, search
Related to web development, hosting, and such: (See also the webdev category)
jQuery: Introduction, some basics, examples · plugin notes · unsorted
node

Server stuff:

Dynamic server stuff:

ECMAscript, Javascript, JScript, etc.

tl;dr:

  • Javascript and JScript are slightly different implementations of the ECMAscript standard.
Each implementation has its own versioning, unrelated to ECMAscript versioning.
  • Most people use 'Javascript' to refer to all of these / "some version or variant of ECMAScript"

The most standard form is the ECMA-262 standard, describing ECMAscript.

You could say that ECMAscript is the language, and Gecko's JavaScript, Microsoft's JScript, and various others are implementations of it. (Various of these names are also trademarked)


Since browsers have long been the most prominent users of javascript, each have a few non-ECMA additions and deviations, particularly around interfaces to other things -- like the DOM.

Things are better these days, but programmers may still want a library to make their life saner.



There are also some formalized extensions, for example:

  • TypeScript, a superset that adds annotated static typing
transcompiled to standard JS. Seems intended as a "strongly typed on the server side, can also be served to browsers" thing
(as an indication how otherwise-similar it is: plain JS is also valid typescript)


  • CoffeeScript, JS-like with a bunch of syntactic sugar. Transcompiles to JS source. [1]
  • JScript.NET, a compiled variant of JScript (and will tend to use .NET rather than COM/ActiveX)



Versions (and versions in common browsers)

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


Let's forget ECMAscript before 3 and Javascript before 1.5, they were ancient even before hip-web standards. You can assume that (very-almost-) everyone has at least (and at most) that level of support now.


ECMAscript is versioned like:

  • 3 (1999) - seems to be the first serious version. (≈JavaScript 1.5)
  • 4 - was a significant redesign of but never happened due to "oh noes will break many sites" worries.
  • 5 - in part a cleanup of 3
  • 5.1 -
  • 6, later renamed ECMAScript 2015 (a.k.a. 6th Edition)
adds various new features - including a good part of the 4-that-never-happened (and e.g. types can be used via TypeScript)
  • ECMAScript 2016 (a.k.a. 7th Edition)
  • ECMAScript 2017 (a.k.a. 8th Edition)
  • ECMAScript 2018 (a.k.a. 9th Edition)
  • ECMAScript 2019 (a.k.a. 10th Edition)


Browsers have at the very least ES3 support, and most modern implementations (≥ 2015, browser or not) are typically at 5, often 5.1(verify).



See also:

Differences and deviations

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Some of the interesting ones:

Syntax

Trailing commas

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas

Indexing a string

DOM

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)