What if value in array is '-1'?
ofca opened this issue · 2 comments
ofca commented
I mean, what if array is something like:
const arr = [3, 4, -1, 3]
then this:
searchByIndex(arr, 2) will return -1
amejiarosario commented
That's a good point. I'll make a fix for it
amejiarosario commented
Fixed with 2b94d37. It will return undefined so -1 can also be in the array