- Accesses length property every loop.
- Accesses length property only once and saves it into a constant.
- Uses forEach method.
array.splice.array.filter.- Manually looping through each of the element to create a new array.
- Unlike
array.filter,array.splicemutates the original array. So these two have different use cases. http://jsben.ch/DA7U2 comparesarray.filterand a regularfor-loop.
inoperator- strict comparison operator
Object.hasOwnPropertyobject.keyexpression
Credits to who ever made it. I simply added a new code block.
array.indexOfarray.includes- for-loop
- while-loop