Others
Exception Handling
Any data type can be thrown as an error. It doesnt have to be an Error object.
try {
throw 'This is just a string';
} catch (e){
console.log(e); // -> 'This is just a string'
}
Destructuring
const [ var1 = '', var2 = '' ] = ['thing1', 'thing2'];
const { key1: var1 = '', key2: var2 = '' } = { key1: 'thing1', key2: 'thing2' };Async\Await
Facilitates iteration with asyncronous calls, waiting for the promise return.
Iterating over awaits
For iterating over array of promisses.
for async of
An easier way of iterating over arrays of promisses.
Last updated