You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
davhojt 5d58cfb6d5 docs(index-of): correct grammar 3 years ago
..
README.md docs(index-of): correct grammar 3 years ago

README.md

Index Of

Instructions

Create 3 functions which accept an array to be searched, and a value to be matched.

  • indexOf: which returns the index of the first occurrence. It also accepts an optional index from where the search should begin. If the value was not found, -1 is returned.
  • lastIndexOf: which works just like your indexOf function, but returns the index of the last occurrence.
  • includes: which returns true if the value was found in the array, and false otherwise.

Of course you must not use any of Array.indexOf(), Array.lastIndexOf() or Array.includes().

Notions

Code provided

The provided code will be added to your solution, and does not need to be submitted.

Array.prototype.indexOf = undefined
Array.prototype.lastIndexOf = undefined
Array.prototype.includes = undefined