ES6 Tricks Note
1 min readDec 4, 2017
ES6 Tricks
// Swap:
[a, b] = [b, a];// Async/Await with Destructuring:
const [user, account] = await Promise.all([
fetch(‘/user’),
fetch(‘/account’)
])
// Clone:
const obj = { …oldObj }
const arr = [ …oldArr ]
// Named parameters:
getStuffAwesome({ id: 150, force: true, verbose: true })