4 ms·
Wouldn’t you want something like “if (i == array.length) { return FALSE}” before the return statement? Returning array.length+1 as “not found” feels like it’s j
by egypturnash 8y ago
Wouldn’t you want something like “if (i == array.length) { return FALSE}” before the return statement? Returning array.length+1 as “not found” feels like it’s just begging for an out of bounds exploit.
Clever example of this approach, though!