Array
El objeto global Array (función constructora global) se extiende con:
- Nuevos métodos estáticos:
from(),of() - Nuevos métodos en el prototipo:
copyWithin(),entries(),fill(),find(),findIndex(),keys(),values()
Array.from(arguments) // [].slice.call(arguments);
Array.from({0: 'hello', 1: world, length: 2}); // ['hello', 'world']
Array.of(1, 2, 3) // [1, 2, 3]
[1, 2, 3, 4, 5].copyWithin(0, 3, 4) // [4, 2, 3, 4, 5]
[1, 2, 3].fill(4) // [4, 4, 4]
[4, 5, 8, 12].find(isPrime) // 5
[4, 5, 8, 12].findIndex(isPrime) // 2
[4, 5, 8, 12].keys() // iterator from 0 to 3
[4, 5, 8, 12].values() // iterator from 4 to 12
⛏ ES6 Katas: Set
Hacer las siguientes katas: