re: Linear and Binary Search in JavaScript VIEW POST

re: Do you mean how would you pass in an array of objects? I modified the function a bit here to allow you to input a sorted array of objects, the key ...

The clean way to extend function to generic types is to override a compare function I'd say

I fully agree, nonetheless that would require using typescript, I had thought about making use of the valueOf function, however I like the way @stepho did it since it is easier to reuse, even more for js newcomers.

code of conduct - report abuse