🌟 ES6 Overview in 350 Bullet Points
See the codeMy ES6 in Depth series consists of 24 articles covering most syntax changes and features coming in ES6. This article aims to summarize all of those, providing you with practical insight into most of ES6, so that you can quickly get started. I've also linked to the articles in ES6 in Depth so that you can easily go deeper on any topic you're interested in.
I heard you like bullet points, so I made an article containing hundreds of those bad boys. To kick things off, here's a table of contents with all the topics covered. It has bullet points in it -- obviously. Note that if you want these concepts to permeate your brain, you'll have a much better time learning the subject by going through the in-depth series and playing around, experimenting with ES6 code yourself.

NumberMathArrayObjectApologies about that long table of contents, and here we go.
es-next, ES2015 -- is the latest finalized specification of the languageES[YYYY] pattern, e.g ES2016 for ES7
ES[YYYY] pattern to refer to newer versionsbabel to transpile ES6 into ES5 for static buildsbabelify to incorporate babel into your Gulp, Grunt, or npm run build processv4.x.x or greater as they have decent ES6 support baked in, thanks to v8babel-node with any version of node, as it transpiles modules into ES5var {foo} = pony is equivalent to var foo = pony.foovar {foo: baz} = pony is equivalent to var baz = pony.foovar {foo='bar'} = baz yields foo: 'bar' if baz.foo is undefinedvar {foo, bar: baz} = {foo: 0, bar: 1} gets you foo: 0 and baz: 1var {foo: {bar}} = { foo: { bar: 'baz' } } gets you bar: 'baz'var {foo: {bar: deep}} = { foo: { bar: 'baz' } } gets you deep: 'baz'undefined as usual, e.g: var {foo} = {}var {foo: {bar}} = {}var [a, b] = [0, 1] yields a: 0 and b: 1var [a, , b] = [0, 1, 2], getting a: 0 and b: 2[a, b] = [b, a]function foo (bar=2) {}function foo (bar={ a: 1, b: 2 }) {}bar completely, like function foo ({ a=1, b=2 }) {}function foo ({ a=1, b=2 } = {}) {}arguments
function foo (...everything) {}everything is an array with all parameters passed to foo...everything, like function foo (bar, ...rest) {}...rest...rest must be the last parameter in the list... syntax
.apply when calling methods, fn(...[1, 2, 3]) is equivalent to fn(1, 2, 3)[1, 2, ...[3, 4, 5], 6, 7][...document.querySelectorAll('img')][a, , ...rest] = [1, 2, 3, 4, 5] yields a: 1 and rest: [3, 4, 5]new + .apply effortless, new Date(...[2015, 31, 8])param => returnValue[1, 2].map(x => x * 2)p1 => expr is okay for a single parameterp1 => expr has an implicit return statement for the provided expr expression() => ({ foo: 'bar' }) or you'll get an error() => expr or (p1, p2) => expr() => {}return, you'll have to provide it -- () => { return 'foo' }this is the same this context as in the parent scopethis can't be modified with .call, .apply, or similar "reflection"-type methodsarguments is also lexically scoped to the nearest normal function; use (...args) for local arguments` (backticks), in addition to " and '`ponyfoo.com is ${rating}` where rating is a variable`${2 * 3}` or `${foo()}`fn prefix to fn`foo, ${bar} and ${baz}` fn is called once with template, ...expressionstemplate is ['foo, ', ' and ', ''] and expressions is [bar, baz]fn becomes the value of the template literal{ foo: foo }, you can just do { foo } -- known as a property value shorthand{ [prefix + 'Foo']: 'bar' }, where prefix: 'moz', yields { mozFoo: 'bar' }{ [foo] } is invalid{ foo () {} }Object sectionclass Foo {}new Foo().bar -- are declared using the short object literal syntax, class Foo { bar () {} }Foo.isPonyFoo() -- need a static keyword prefix, class Foo { static isPonyFoo () {} }class Foo { constructor () { /* initialize instance */ } }class PonyFoo extends Foo {}let and const are alternatives to var when declaring variableslet is block-scoped instead of lexically scoped to a functionlet is hoisted to the top of the block, while var declarations are hoisted to top of the functionlet foo was declaredlet foo statement was placed in user code (hoisiting is irrelevant here)foo within the TDZ (before the let foo statement is reached) result in an errorconst is also block-scoped, hoisted, and constrained by TDZ semanticsconst variables must be declared using an initializer, const foo = 'bar'const after initialization fails silently (or loudly -- with an exception -- under strict mode)const variables don’t make the assigned value immutable
const foo = { bar: 'baz' } means foo will always reference the right-hand side objectconst foo = { bar: 'baz' }; foo.bar = 'boo' won't throw{ let _foo = 'secret', bar = () => _foo; }var symbol = Symbol()Symbol('ponyfoo')Symbol(), Symbol(), Symbol('foo') and Symbol('foo') are all differentsymbol, thus: typeof Symbol() === 'symbol'Symbol.for(key)
key already existed, you get that one backkey as its description as wellSymbol.keyFor(symbol) is the inverse function, taking a symbol and returning its keywindow contexteval context<iframe> context, Symbol.for('foo') === iframe.contentWindow.Symbol.for('foo')Symbol[name], e.g: Symbol.iteratorSymbol.iterator === iframe.contentWindow.Symbol.iteratorSymbol.iteratorObject.getOwnPropertySymbolsSymbol is used to assign an iterator to any objectvar foo = { [Symbol.iterator]: iterable}, or foo[Symbol.iterator] = iterableiterable is a method that returns an iterator object that has a next methodnext method returns objects with two properties, value and done
value property indicates the current value in the sequence being iterateddone property indicates whether there are any more items to iterate[Symbol.iterator] value are iterable, because they subscribe to the iterable protocolArray, String, or arguments -- and NodeList in browsers -- are iterable by default in ES6for..of, such as for (let el of document.querySelectorAll('a'))[...document.querySelectorAll('a')]Array.from(document.querySelectorAll('a')) to synthesize an iterable sequence into an array... or Array.from as that will cause an infinite loopfunction* generator () {} syntaxyield to emit an element sequenceyield* to delegate to another generator function -- or any iterable objectg = generator(), g adheres to the iterable protocol because g[Symbol.iterator] is a methodg = generator(), g adheres to the iterator protocol because g.next is a methodg is the generator itself: g[Symbol.iterator]() === gArray.from(g), [...g], for (let item of g), or just calling g.next()yield expression returning the next value in the sequencereturn statement returning the last value in the sequencethrow statement halts execution in the generator entirely{ done: true }g sequence has ended, g.next() simply returns { done: true } and has no effectg.next(), unsuspending execution in user codePromises/A+ specification, was widely implemented in the wild before ES6 was standarized (e.g bluebird)p.then(handler) and p.catch(handler)p promises with new Promise((resolve, reject) => { /* resolver */ })
resolve(value) callback will fulfill the promise with the provided valuereject(reason) callback will reject p with a reason errorp.then and p.catch creates another promise that's blocked on p being settled.then handlers or .catch handlers, never both.then callback can transform the result of the previous branch by returning a value.then callback can block on another promise by returning itp.catch(fn).catch(fn) won't do what you want -- unless what you wanted is to catch errors in the error handlerPromise.resolve(value) creates a promise that's fulfilled with the provided valuePromise.reject(reason) creates a promise that's rejected with the provided reasonPromise.all(...promises) creates a promise that settles when all ...promises are fulfilled or 1 of them is rejectedPromise.race(...promises) creates a promise that settles as soon as 1 of ...promises is settledkey to an entryMap adheres to iterable protocolmap using new Map()iterable like [[key1, value1], [key2, value2]] in new Map(iterable)map.set(key, value) to add entriesmap.get(key) to get an entrykey using map.has(key)map.delete(key)map with for (let [key, value] of map), the spread operator, Array.from, etcMap, but not quite the sameWeakMap isn't iterable, so you don't get enumeration methods like .forEach, .clear, and others you had in MapWeakMap keys must be reference types. You can't use value types like symbols, numbers, or strings as keysWeakMap entries with a key that's the only reference to the referenced variable are subject to garbage collectionWeakMap is great at keeping around metadata for objects, while those objects are still in useWeakMap as IDisposable in .NETMap, but not quite the sameSet doesn't have keys, there's only valuesset.set(value) doesn't look right, so we have set.add(value) insteadWeakSet is sort of a cross-breed between Set and WeakMapWeakSet is a set that can't be iterated and doesn't have enumeration methodsWeakSet values must be reference typesWeakSet may be useful for a metadata table indicating whether a reference is actively in use or notnew Proxy(target, handler), where target is any object and handler is configurationproxy acts as a passthrough to the underlying target objecttarget object is accessed on top of regular object property access semanticsproxy and retain strict control over how target can be interacted withProxy.revocable(target, handler)
proxy and revoke propertiesvar {proxy, revoke} = Proxy.revocable(target, handler) for convenienceproxy all the same as with new Proxy(target, handler)revoke() is called, the proxy will throw on any operation, making it convenient when you can't trust consumersget -- traps proxy.prop and proxy['prop']set -- traps proxy.prop = value and proxy['prop'] = valuehas -- traps in operatordeleteProperty -- traps delete operatordefineProperty -- traps Object.defineProperty and declarative alternativesenumerate -- traps for..in loopsownKeys -- traps Object.keys and related methodsapply -- traps function callsconstruct -- traps usage of the new operatorgetPrototypeOf -- traps internal calls to [[GetPrototypeOf]]setPrototypeOf -- traps calls to Object.setPrototypeOfisExtensible -- traps calls to Object.isExtensiblepreventExtensions -- traps calls to Object.preventExtensionsgetOwnPropertyDescriptor -- traps calls to Object.getOwnPropertyDescriptorReflection is a new static built-in (think of Math) in ES6Reflection methods have sensible internals, e.g Reflect.defineProperty returns a boolean instead of throwingReflection method for each proxy trap handler, and they represent the default behavior of each trapObject.keys will be placed in the Reflection namespaceNumber0b prefix for binary, and 0o prefix for octal integer literalsNumber.isNaN and Number.isFinite are like their global namesakes, except that they don't coerce input to NumberNumber.parseInt and Number.parseFloat are exactly the same as their global namesakesNumber.isInteger checks if input is a Number value that doesn’t have a decimal partNumber.EPSILON helps figure out negligible differences between two numbers -- e.g. 0.1 + 0.2 and 0.3Number.MAX_SAFE_INTEGER is the largest integer that can be safely and precisely represented in JavaScriptNumber.MIN_SAFE_INTEGER is the smallest integer that can be safely and precisely represented in JavaScriptNumber.isSafeInteger checks whether an integer is within those bounds, able to be represented safely and preciselyNumber Improvements in DepthMathMath.sign -- sign function of a numberMath.trunc -- integer part of a numberMath.cbrt -- cubic root of value, or ∛‾valueMath.expm1 -- e to the value minus 1, or evalue - 1Math.log1p -- natural logarithm of value + 1, or ln(value + 1)Math.log10 -- base 10 logarithm of value, or log10(value)Math.log2 -- base 2 logarithm of value, or log2(value)Math.sinh -- hyperbolic sine of a numberMath.cosh -- hyperbolic cosine of a numberMath.tanh -- hyperbolic tangent of a numberMath.asinh -- hyperbolic arc-sine of a numberMath.acosh -- hyperbolic arc-cosine of a numberMath.atanh -- hyperbolic arc-tangent of a numberMath.hypot -- square root of the sum of squaresMath.clz32 -- leading zero bits in the 32-bit representation of a numberMath.imul -- C-like 32-bit multiplicationMath.fround -- nearest single-precision float representation of a numberMath Additions in DepthArrayArray.from -- create Array instances from arraylike objects like arguments or iterablesArray.of -- similar to new Array(...items), but without special casesArray.prototype.copyWithin -- copies a sequence of array elements into somewhere else in the arrayArray.prototype.fill -- fills all elements of an existing array with the provided valueArray.prototype.find -- returns the first item to satisfy a callbackArray.prototype.findIndex -- returns the index of the first item to satisfy a callbackArray.prototype.keys -- returns an iterator that yields a sequence holding the keys for the arrayArray.prototype.values -- returns an iterator that yields a sequence holding the values for the arrayArray.prototype.entries -- returns an iterator that yields a sequence holding key value pairs for the arrayArray.prototype[Symbol.iterator] -- exactly the same as the Array.prototype.values methodArray Extensions in DepthObjectObject.assign -- recursive shallow overwrite for properties from target, ...objectsObject.is -- like using the === operator, but true for NaN vs NaN, and false for +0 vs -0Object.getOwnPropertySymbols -- returns all own property symbols found on an objectObject.setPrototypeOf -- changes prototype. Equivalent to Object.prototype.__proto__ setterObject Changes in DepthString.prototype.startsWith -- whether the string starts with valueString.prototype.endsWith -- whether the string ends in valueString.prototype.includes -- whether the string contains value anywhereString.prototype.repeat -- returns the string repeated amount timesString.prototype[Symbol.iterator] -- lets you iterate over a sequence of unicode code points (not characters)String.prototype.codePointAt -- base-10 numeric representation of a code point at a given position in stringString.fromCodePoint -- given ...codepoints, returns a string made of their unicode representationsString.prototype.normalize -- returns a normalized version of the string's unicode representationexport an APIexport default value exports a default bindingexport var foo = 'bar' exports a named bindingexport { foo, bar } exports a list of named exportsexport { foo as ponyfoo } aliases the export to be referenced as ponyfoo insteadexport { foo as default } marks the named export as the default exportexport default api at the end of all your modules, where api is an object, avoids confusionimport 'foo' loads the foo module into the current moduleimport foo from 'ponyfoo' assigns the default export of ponyfoo to a local foo variableimport {foo, bar} from 'baz' imports named exports foo and bar from the baz moduleimport {foo as bar} from 'baz' imports named export foo but aliased as a bar variableimport {default} from 'foo' also imports the default exportimport {default as bar} from 'foo' imports the default export aliased as barimport foo, {bar, baz} from 'foo' mixes default foo with named exports bar and baz in one declarationimport * as foo from 'foo' imports the namespace object
foo[name]foo.default, if a default export was declared in the moduleTime for a bullet point detox. Then again, I did warn you to read the article series instead. Don't forget to subscribe and maybe even contribute to keep Pony Foo alive. Also, did you try the Konami code just yet?
389 followers · starred Nov 2015
343 followers · starred Dec 2015
274 followers · starred Dec 2015
82 followers · starred Nov 2015
🌟 ES6 Overview in 350 Bullet Points
See the codeMy ES6 in Depth series consists of 24 articles covering most syntax changes and features coming in ES6. This article aims to summarize all of those, providing you with practical insight into most of ES6, so that you can quickly get started. I've also linked to the articles in ES6 in Depth so that you can easily go deeper on any topic you're interested in.
I heard you like bullet points, so I made an article containing hundreds of those bad boys. To kick things off, here's a table of contents with all the topics covered. It has bullet points in it -- obviously. Note that if you want these concepts to permeate your brain, you'll have a much better time learning the subject by going through the in-depth series and playing around, experimenting with ES6 code yourself.

NumberMathArrayObjectApologies about that long table of contents, and here we go.
es-next, ES2015 -- is the latest finalized specification of the languageES[YYYY] pattern, e.g ES2016 for ES7
ES[YYYY] pattern to refer to newer versionsbabel to transpile ES6 into ES5 for static buildsbabelify to incorporate babel into your Gulp, Grunt, or npm run build processv4.x.x or greater as they have decent ES6 support baked in, thanks to v8babel-node with any version of node, as it transpiles modules into ES5var {foo} = pony is equivalent to var foo = pony.foovar {foo: baz} = pony is equivalent to var baz = pony.foovar {foo='bar'} = baz yields foo: 'bar' if baz.foo is undefinedvar {foo, bar: baz} = {foo: 0, bar: 1} gets you foo: 0 and baz: 1var {foo: {bar}} = { foo: { bar: 'baz' } } gets you bar: 'baz'var {foo: {bar: deep}} = { foo: { bar: 'baz' } } gets you deep: 'baz'undefined as usual, e.g: var {foo} = {}var {foo: {bar}} = {}var [a, b] = [0, 1] yields a: 0 and b: 1var [a, , b] = [0, 1, 2], getting a: 0 and b: 2[a, b] = [b, a]function foo (bar=2) {}function foo (bar={ a: 1, b: 2 }) {}bar completely, like function foo ({ a=1, b=2 }) {}function foo ({ a=1, b=2 } = {}) {}arguments
function foo (...everything) {}everything is an array with all parameters passed to foo...everything, like function foo (bar, ...rest) {}...rest...rest must be the last parameter in the list... syntax
.apply when calling methods, fn(...[1, 2, 3]) is equivalent to fn(1, 2, 3)[1, 2, ...[3, 4, 5], 6, 7][...document.querySelectorAll('img')][a, , ...rest] = [1, 2, 3, 4, 5] yields a: 1 and rest: [3, 4, 5]new + .apply effortless, new Date(...[2015, 31, 8])param => returnValue[1, 2].map(x => x * 2)p1 => expr is okay for a single parameterp1 => expr has an implicit return statement for the provided expr expression() => ({ foo: 'bar' }) or you'll get an error() => expr or (p1, p2) => expr() => {}return, you'll have to provide it -- () => { return 'foo' }this is the same this context as in the parent scopethis can't be modified with .call, .apply, or similar "reflection"-type methodsarguments is also lexically scoped to the nearest normal function; use (...args) for local arguments` (backticks), in addition to " and '`ponyfoo.com is ${rating}` where rating is a variable`${2 * 3}` or `${foo()}`fn prefix to fn`foo, ${bar} and ${baz}` fn is called once with template, ...expressionstemplate is ['foo, ', ' and ', ''] and expressions is [bar, baz]fn becomes the value of the template literal{ foo: foo }, you can just do { foo } -- known as a property value shorthand{ [prefix + 'Foo']: 'bar' }, where prefix: 'moz', yields { mozFoo: 'bar' }{ [foo] } is invalid{ foo () {} }Object sectionclass Foo {}new Foo().bar -- are declared using the short object literal syntax, class Foo { bar () {} }Foo.isPonyFoo() -- need a static keyword prefix, class Foo { static isPonyFoo () {} }class Foo { constructor () { /* initialize instance */ } }class PonyFoo extends Foo {}let and const are alternatives to var when declaring variableslet is block-scoped instead of lexically scoped to a functionlet is hoisted to the top of the block, while var declarations are hoisted to top of the functionlet foo was declaredlet foo statement was placed in user code (hoisiting is irrelevant here)foo within the TDZ (before the let foo statement is reached) result in an errorconst is also block-scoped, hoisted, and constrained by TDZ semanticsconst variables must be declared using an initializer, const foo = 'bar'const after initialization fails silently (or loudly -- with an exception -- under strict mode)const variables don’t make the assigned value immutable
const foo = { bar: 'baz' } means foo will always reference the right-hand side objectconst foo = { bar: 'baz' }; foo.bar = 'boo' won't throw{ let _foo = 'secret', bar = () => _foo; }var symbol = Symbol()Symbol('ponyfoo')Symbol(), Symbol(), Symbol('foo') and Symbol('foo') are all differentsymbol, thus: typeof Symbol() === 'symbol'Symbol.for(key)
key already existed, you get that one backkey as its description as wellSymbol.keyFor(symbol) is the inverse function, taking a symbol and returning its keywindow contexteval context<iframe> context, Symbol.for('foo') === iframe.contentWindow.Symbol.for('foo')Symbol[name], e.g: Symbol.iteratorSymbol.iterator === iframe.contentWindow.Symbol.iteratorSymbol.iteratorObject.getOwnPropertySymbolsSymbol is used to assign an iterator to any objectvar foo = { [Symbol.iterator]: iterable}, or foo[Symbol.iterator] = iterableiterable is a method that returns an iterator object that has a next methodnext method returns objects with two properties, value and done
value property indicates the current value in the sequence being iterateddone property indicates whether there are any more items to iterate[Symbol.iterator] value are iterable, because they subscribe to the iterable protocolArray, String, or arguments -- and NodeList in browsers -- are iterable by default in ES6for..of, such as for (let el of document.querySelectorAll('a'))[...document.querySelectorAll('a')]Array.from(document.querySelectorAll('a')) to synthesize an iterable sequence into an array... or Array.from as that will cause an infinite loopfunction* generator () {} syntaxyield to emit an element sequenceyield* to delegate to another generator function -- or any iterable objectg = generator(), g adheres to the iterable protocol because g[Symbol.iterator] is a methodg = generator(), g adheres to the iterator protocol because g.next is a methodg is the generator itself: g[Symbol.iterator]() === gArray.from(g), [...g], for (let item of g), or just calling g.next()yield expression returning the next value in the sequencereturn statement returning the last value in the sequencethrow statement halts execution in the generator entirely{ done: true }g sequence has ended, g.next() simply returns { done: true } and has no effectg.next(), unsuspending execution in user codePromises/A+ specification, was widely implemented in the wild before ES6 was standarized (e.g bluebird)p.then(handler) and p.catch(handler)p promises with new Promise((resolve, reject) => { /* resolver */ })
resolve(value) callback will fulfill the promise with the provided valuereject(reason) callback will reject p with a reason errorp.then and p.catch creates another promise that's blocked on p being settled.then handlers or .catch handlers, never both.then callback can transform the result of the previous branch by returning a value.then callback can block on another promise by returning itp.catch(fn).catch(fn) won't do what you want -- unless what you wanted is to catch errors in the error handlerPromise.resolve(value) creates a promise that's fulfilled with the provided valuePromise.reject(reason) creates a promise that's rejected with the provided reasonPromise.all(...promises) creates a promise that settles when all ...promises are fulfilled or 1 of them is rejectedPromise.race(...promises) creates a promise that settles as soon as 1 of ...promises is settledkey to an entryMap adheres to iterable protocolmap using new Map()iterable like [[key1, value1], [key2, value2]] in new Map(iterable)map.set(key, value) to add entriesmap.get(key) to get an entrykey using map.has(key)map.delete(key)map with for (let [key, value] of map), the spread operator, Array.from, etcMap, but not quite the sameWeakMap isn't iterable, so you don't get enumeration methods like .forEach, .clear, and others you had in MapWeakMap keys must be reference types. You can't use value types like symbols, numbers, or strings as keysWeakMap entries with a key that's the only reference to the referenced variable are subject to garbage collectionWeakMap is great at keeping around metadata for objects, while those objects are still in useWeakMap as IDisposable in .NETMap, but not quite the sameSet doesn't have keys, there's only valuesset.set(value) doesn't look right, so we have set.add(value) insteadWeakSet is sort of a cross-breed between Set and WeakMapWeakSet is a set that can't be iterated and doesn't have enumeration methodsWeakSet values must be reference typesWeakSet may be useful for a metadata table indicating whether a reference is actively in use or notnew Proxy(target, handler), where target is any object and handler is configurationproxy acts as a passthrough to the underlying target objecttarget object is accessed on top of regular object property access semanticsproxy and retain strict control over how target can be interacted withProxy.revocable(target, handler)
proxy and revoke propertiesvar {proxy, revoke} = Proxy.revocable(target, handler) for convenienceproxy all the same as with new Proxy(target, handler)revoke() is called, the proxy will throw on any operation, making it convenient when you can't trust consumersget -- traps proxy.prop and proxy['prop']set -- traps proxy.prop = value and proxy['prop'] = valuehas -- traps in operatordeleteProperty -- traps delete operatordefineProperty -- traps Object.defineProperty and declarative alternativesenumerate -- traps for..in loopsownKeys -- traps Object.keys and related methodsapply -- traps function callsconstruct -- traps usage of the new operatorgetPrototypeOf -- traps internal calls to [[GetPrototypeOf]]setPrototypeOf -- traps calls to Object.setPrototypeOfisExtensible -- traps calls to Object.isExtensiblepreventExtensions -- traps calls to Object.preventExtensionsgetOwnPropertyDescriptor -- traps calls to Object.getOwnPropertyDescriptorReflection is a new static built-in (think of Math) in ES6Reflection methods have sensible internals, e.g Reflect.defineProperty returns a boolean instead of throwingReflection method for each proxy trap handler, and they represent the default behavior of each trapObject.keys will be placed in the Reflection namespaceNumber0b prefix for binary, and 0o prefix for octal integer literalsNumber.isNaN and Number.isFinite are like their global namesakes, except that they don't coerce input to NumberNumber.parseInt and Number.parseFloat are exactly the same as their global namesakesNumber.isInteger checks if input is a Number value that doesn’t have a decimal partNumber.EPSILON helps figure out negligible differences between two numbers -- e.g. 0.1 + 0.2 and 0.3Number.MAX_SAFE_INTEGER is the largest integer that can be safely and precisely represented in JavaScriptNumber.MIN_SAFE_INTEGER is the smallest integer that can be safely and precisely represented in JavaScriptNumber.isSafeInteger checks whether an integer is within those bounds, able to be represented safely and preciselyNumber Improvements in DepthMathMath.sign -- sign function of a numberMath.trunc -- integer part of a numberMath.cbrt -- cubic root of value, or ∛‾valueMath.expm1 -- e to the value minus 1, or evalue - 1Math.log1p -- natural logarithm of value + 1, or ln(value + 1)Math.log10 -- base 10 logarithm of value, or log10(value)Math.log2 -- base 2 logarithm of value, or log2(value)Math.sinh -- hyperbolic sine of a numberMath.cosh -- hyperbolic cosine of a numberMath.tanh -- hyperbolic tangent of a numberMath.asinh -- hyperbolic arc-sine of a numberMath.acosh -- hyperbolic arc-cosine of a numberMath.atanh -- hyperbolic arc-tangent of a numberMath.hypot -- square root of the sum of squaresMath.clz32 -- leading zero bits in the 32-bit representation of a numberMath.imul -- C-like 32-bit multiplicationMath.fround -- nearest single-precision float representation of a numberMath Additions in DepthArrayArray.from -- create Array instances from arraylike objects like arguments or iterablesArray.of -- similar to new Array(...items), but without special casesArray.prototype.copyWithin -- copies a sequence of array elements into somewhere else in the arrayArray.prototype.fill -- fills all elements of an existing array with the provided valueArray.prototype.find -- returns the first item to satisfy a callbackArray.prototype.findIndex -- returns the index of the first item to satisfy a callbackArray.prototype.keys -- returns an iterator that yields a sequence holding the keys for the arrayArray.prototype.values -- returns an iterator that yields a sequence holding the values for the arrayArray.prototype.entries -- returns an iterator that yields a sequence holding key value pairs for the arrayArray.prototype[Symbol.iterator] -- exactly the same as the Array.prototype.values methodArray Extensions in DepthObjectObject.assign -- recursive shallow overwrite for properties from target, ...objectsObject.is -- like using the === operator, but true for NaN vs NaN, and false for +0 vs -0Object.getOwnPropertySymbols -- returns all own property symbols found on an objectObject.setPrototypeOf -- changes prototype. Equivalent to Object.prototype.__proto__ setterObject Changes in DepthString.prototype.startsWith -- whether the string starts with valueString.prototype.endsWith -- whether the string ends in valueString.prototype.includes -- whether the string contains value anywhereString.prototype.repeat -- returns the string repeated amount timesString.prototype[Symbol.iterator] -- lets you iterate over a sequence of unicode code points (not characters)String.prototype.codePointAt -- base-10 numeric representation of a code point at a given position in stringString.fromCodePoint -- given ...codepoints, returns a string made of their unicode representationsString.prototype.normalize -- returns a normalized version of the string's unicode representationexport an APIexport default value exports a default bindingexport var foo = 'bar' exports a named bindingexport { foo, bar } exports a list of named exportsexport { foo as ponyfoo } aliases the export to be referenced as ponyfoo insteadexport { foo as default } marks the named export as the default exportexport default api at the end of all your modules, where api is an object, avoids confusionimport 'foo' loads the foo module into the current moduleimport foo from 'ponyfoo' assigns the default export of ponyfoo to a local foo variableimport {foo, bar} from 'baz' imports named exports foo and bar from the baz moduleimport {foo as bar} from 'baz' imports named export foo but aliased as a bar variableimport {default} from 'foo' also imports the default exportimport {default as bar} from 'foo' imports the default export aliased as barimport foo, {bar, baz} from 'foo' mixes default foo with named exports bar and baz in one declarationimport * as foo from 'foo' imports the namespace object
foo[name]foo.default, if a default export was declared in the moduleTime for a bullet point detox. Then again, I did warn you to read the article series instead. Don't forget to subscribe and maybe even contribute to keep Pony Foo alive. Also, did you try the Konami code just yet?
389 followers · starred Nov 2015
343 followers · starred Dec 2015
274 followers · starred Dec 2015
82 followers · starred Nov 2015