arrays
arrays
docs
MDN
links
30s of Code
tags
#javascript
#arrays
iteration (12)
find
findIndex
keys
values
entries
forEach
fruits.forEach(function(item, index, array) {
console.log(item, index);
});
every
some
filter
map
reduce
reduceRight
accessor(9)
concat
indexOf
join
includes
var array1 = [1, 2, 3];
console.log(array1.includes(2));
// expected output: true
lastIndexOf
slice
to
Source
String
LocaleString
mutator (10)
push
pop
shift
unshift
splice
var months = ['Jan', 'March', 'April', 'June'];
months.splice(1, 0, 'Feb');
// inserts at index 1
console.log(months);
// expected output: Array ['Jan', 'Feb', 'March', 'April', 'June']
sort
reverse
fill
copyWithin