It returns an item on the left if and only if it is right.
The following are not true:
- The simplest logical value
false - The value of a primitive string
""(empty string) - numbers +0, -0 and
NaN - primitive meaning
null - primitive meaning
undefined
Everything else is true.
Here is a list of language specifications .
In your case, cache[0]returns 0, which, as we see, is false, so it introduces recursion. That is why we avoid ||short circuits in these situations.
, : number in cache - , - cache[number] !== undefined.