Resource: Eloquent Javascript, 2nd Edition by Marijn Haverbeke
What is Javascript?
- JavaScript (henceforth JS) created in 1995 to add programs to web pages in the Netscape Navigator browser
- Major graphical web browsers have since adopted JS
- JS has made modern web applications possible
- “Modern web applications = applications with which you can interact directly without doing a reload for every action”
- Also used in websites to provide interactivity
NB: Netscape – a series of web browsers produced by Netscape Communications Corporation (now a subsidiary of AOL); original browser once the dominant browser in terms of usage share (proportion of visitors to web sites that use a certain web browser), but lost to Internet Explorer in the first browser war (competition for dominance in the usage share of web browsers) (first war — Microsoft’s Internet Explorer vs. Netscape’s Navigator)
—Wikipedia: Netscape (web browser)
- ECMAScript standard : a standard document that describes the way JS should work to ensure that software claiming to support JS really does support JS ; named after Ecma International, the organization that did the standardization
- ECMAScript and JS can be used interchangeably (two names for the same language)
Disadvantages of JS
- JS is “ridiculously liberal in what it allows” — almost any command is accepted, but is then interpreted differently
- Idea behind this design: make programming in JS easier for beginners
- Reality: Makes finding program errors harder because the system will not point them out to you
Advantages of JS
- Flexibility allows for many techniques that are impossible in more rigid languages
Different versions
- Version 3 — widely supported version btwn ~ 2000-2010, the time of JS’s ascent to dominance
- Version 4 — “changing a living, widely used language … turned out to be politically difficult” — work abandoned in 2008
- Version 5 — came out in 2009
- Version 5.1 — 2011 — Editorial changes —w3schools
- Version 6 — 2015 — Added classes and modules —w3schools
- Version 7 — 2016 — added exponential operator (**); added Array.prototype.includes –w3schools
- This book’s edition came out in 2014 so it will focus on Version 5, which all major browsers support; we should focus on using Version 6, which all major browsers are in the process of supporting
- Platforms on which JS is used: Web browsers, databases i.e. MongoDB, CouchDB (use JS as their scripting and query language)
- Several platforms for desktop and server programming i.e. notably, Node.js, provides a powerful environment for programming JS outside of the browser