something === something_else , , , , , :
typeof arr[i] === "undefined", num < arr[i], javascript .
, , typeof arr[i] === "undefined", num < arr[i] . >=, .
:
if (typeof arr[i] === "undefined" || num < arr[i])
:
if (!(num >= arr[i]))
...
, , , , . : ?
why do you even have undefined data in the list? Could you filter this out before writing to the list, and not while reading? It is a good idea to always have only one data type in the contaioner (unless you have a really good reason)
if you have a mapping of keys and values with some undefined keys, perhaps Array is not a suitable container for your use.
zvone source
share