➕ More Array Methods
- concat - merge arrays
- includes - look for a value
- indexOf - just like string.indexOf
- reverse - reverses an array
💑 concat() - merge arrays
let cats = ['blue', 'kitty']
let dogs = ['rusty', 'wyatt']
cats.concat(dogs);
dogs.concat(cats);
cats
dogs
let comboParty = dogs.concat(cats);
comboParty
👻 includes() - look for a value
let cats = ['blue', 'kitty']
cats.includes('blue')
cats.includes('Blue')
🎐 indexOf() - just like string.indexOf
"Blue".indexOf('B')
"Blue".indexOf('e')
"Blue".indexOf('0')
comboParty
comboParty.indexOf('rusty')
comboParty.indexOf('kitty')
comboParty.indexOf('ASDQWEZXC')
💔 reverse() - reverses an array
comboParty
comboParty.reverse();
comboParty
comboParty.push("blue");
comboParty.indexOf('blue')