#coding
Read more stories on Hashnode
Articles with this tag
unshift Add an element to the front of an array Array.prototype._unshift = function(...values) { const newArray = [...values, ...this] this.length...
push Add an element to the end of the array(JS has a dynamic array). Array.prototype._push = function(...values) { for(let i = 0; i <...
includes Return true if the item is in the array otherwise, return false. Array.prototype._includes = function(value, fromIndex = 0) { for(let i =...
findIndex Returns the index of the element that returns true on a callback function. Array.prototype._findIndex = function(cbFunction) { for(let i...
Basic implementation of find() & findLast() JS array methods. · find Returns the first element that satisfies the testing function otherwise returns...
Basic implementation of JS some and every method. · some Returns true if at least the callback function returns true otherwise...