Slide 43
Slide 43 text
New Array methods
gjs> Array(5).fill(3);
3,3,3,3,3
gjs> [1,2,3,4,5].find(i => i >
3.5);
4
gjs> Array.from('foo');
F,o,o
gjs> Array.from(arguments);
gjs> [1,2,3,4,5].includes(4);
true
Filling in some useful missing operations in
the standard library!
...nicer than Array.prototype.slice.call
More: Array.copyWithin(), Array.fill(),
Array.find(), Array.findIndex(), Array.of(),
Array.entries(), Array.keys()
3.26
3.24