The above findIndex() method takes two arguments: The syntax of the findIndex() method is as follows findIndex(testfunc(currentValue, index, arr), thisValue) If no element of the array satisfies the testing condition, it returns -1. The findIndex() method returns the index of the first element in array that satisfies the given testing function. The prototype constructor allows you to add new properties and methods to the Array() object. This method was added to the array.prototype() in the JavaScript ES6. Today, let us understand how the findIndex() method works. JavaScript methods are actions that can be performed on objects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |