Created
April 20, 2012 04:18
-
-
Save sym3tri/2425983 to your computer and use it in GitHub Desktop.
New features of ES5 summarized
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Trailing commas are ok | |
- No reserved words for property names | |
- NaN, Infinity, undefined : are all constants | |
- parseInt() defaults to radix 10 | |
- /regexp/ produces new reg ex object every time | |
- JSON.parse(), JSON.stringify() | |
- Function.prototype.bind | |
- String.prototype.trim | |
- Array.prototype.every, filter, forEach, indexOf, lastIndexOf, map, reduce, reduceRight, some, | |
- Date.now() | |
- Date.prototype.toISOString | |
- new Date(string) and Date.parse(string) will try ISO format 1st | |
- Array.isArray() | |
- Object.keys(), Object.create(), Object.defineProperty, Object.defineProperties, | |
Object.getOwnPropertyDescriptor(), Object.getOwnPropertyNames(obj), Object.getPrototypeOf(obj) | |
- Object.seal(), Object.freeze(), Object.preventExtensions(), Object.isSealed(), Object.isFrozen(), | |
Object.isExtensible() | |
- Property attributes: writeable, value, enumerable, configurable, get, set | |
- 'use strict'; | |
- Strict Mode: | |
No more implied global variables within functions. | |
this is not bound to the global object by function form. | |
apply and call do not default to the global object. | |
No with statement. | |
Setting a writeable: false property will throw. | |
Deleting a configurable: false property will throw. | |
Restrictions on eval. | |
eval and arguments are reserved. | |
arguments not linked to parameters. | |
No more arguments.caller or arguments.callee. | |
No more octal literals. | |
Duplicate names in an object literal or function parameters are a syntax error | |
references: | |
http://www.slideshare.net/douglascrockford/level-7-ecmascript-5-the-new-parts | |
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object | |
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array#Methods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great summary, thanks!