9 Code Assists for Arrays and Loops
- Convert array.filter() to array.find()
- Convert array.indexOf() into array.includes()
- Convert string comparison chain to array.includes()
|| value === 'aString'and
&& value !== 'aString'chains with
- Convert loop to .forEach
- Convert loop to for…of
- Convert loop to for
for…ofwith a regular
forloop that has an index variable.
- Convert loop to .map()
Convert a loop with
- Move array element
Move an array element up or down.
- Move object property
Move an object property up or down.