Javascript Basics
History
1995: Beginnings
- 04/1995 - Created by Brendan Eich in 10 days
- Original goal - to put Scheme 'in the browser'
- Developed under the name Mocha, but officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995
- Renamed JavaScript when it was deployed in the Netscape Navigator 2.0 beta 3 in December.
- This caused confusion, giving the impression that the language was a spin-off of the Java programming language
- Characterized as a marketing ploy by Netscape since Java was the hot new Web programming language.
1996-99: A Star is Born
- 11/96 - Netscape submitted JavaScript to Ecma International
- 06/97 - ECMAScript published in the first edition of the ECMA-262 standard
- 06/98 - ECMAScript 2
- 12/99 - ECMAScript 3
2000-04: The Silent Years
- Attempts to create and implement ECMAScript 4
- ECMAScript 4 is a huge change from previous versions (included a lot of what is in ECMAScript 2015 and more)
- Microsoft wasn't interested in collaborating in the standardization process
- Other companies disagree on the direction the language should take
- Work on version 4 was halted
2005-07: Consolidation
- Similar technologies like ActionScript took ideas from ECMAScript 4 and developed them, later feeding back into later ECMAScript versions
- Yahoo, Microsoft, Google, and other 4th edition dissenters formed their own subcommittee to design a less ambitious update of ECMAScript 3 (ECMAScript 3.1
2008-11: Progress
- 07/2008 - Brendan Eich announces TC39 would focus on v 3.1 which is later renamed to v 5
- 12/2009 - ECMAScript 5 is published
- 06/2011 - ECMAScript 5.1 is published (international standards alignment - no new features)
2012-2015: Harmony
- From 2009-15 TC39 committee works collaboratively again to create ECMAScript 6 "Harmony" :)
- 06/2016 - ECMAScript 6 is published and renamed to ECMAScript 2015 to align with the TC39 committee's desire to no longer release large updates infrequently but instead release small updates on a yearly basis
- ECMAScript 6 includes some features from the failed ECMAScript 4
https://babeljs.io/docs/learn-es2015/
2016-Present: The Future
- ECMAScript 2015 is still being implemented in browsers - none have full support (as of 2016/07/19)
https://kangax.github.io/compat-table/es6/ - 06/2016 - ECMAScript 2016 is published
- Includes only 2 new features
http://www.2ality.com/2016/01/ecmascript-2016.html- Array.prototype.includes
['1', '2'].includes('1') === true - Exponentiation operator
3 ** 2 === 9
- Array.prototype.includes
- Work is now being done on ECMAScript 2017
- Uses proposal tier system (0-4)
https://github.com/tc39/ecma262
- Uses proposal tier system (0-4)
What is it?!
What does Wikipedia say?
- "JavaScript is a high-level, dynamic, untyped, and interpreted programming language" - Wikipedia
- Javascript is typed, but it's loosely typed or dynamically typed, not untyped
See: typeof (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) - Modern Javascript is compiled (possibly JIT) and then interpreted
It's a bird, a plane and superman
- Imperative & structured
- Function scoping (not block)
- Dynamic typing
- Prototypical inheritance (OO) and object based
- Functional (first class functions)
- Infinite function parameters
- Object and array literals
- Borrowed from several programming languages: Java (syntax, primitive values versus objects), Scheme and AWK (first-class functions), Self (prototypal inheritance), and Perl and Python (strings, arrays, and regular expressions).
Common Confusionings
- Execution context vs function scope
http://ryanmorr.com/understanding-scope-and-context-in-javascript/ - Most implementations are tied to the DOM, except the ones that aren't (NodeJS)
- Bullet Three
Related 'languages'
- Typescript
- Coffeescript
- Actionscript
- Dart
- Elm
- Experimental features through transpilers (ex Decorators)
Let's code!
git clone git@github.com:sgwatgit/jsbasics.git
Javascript Basics
By Sean Wright
Javascript Basics
Javascript Basics 1
- 454