3 ms·
> Where the |0 is a no-op so not actually done, just a type hint. if value is null / undefined / empty object / empty array, empty string... | 0 wouldn't be no
by merb 9y ago
> Where the |0 is a no-op so not actually done, just a type hint.
if value is null / undefined / empty object / empty array, empty string... | 0 wouldn't be no-op it would actually assign 0 to a.
- dbaupp 9y agoWhen JS is a compiler target, that truck will generally only be used if the source language excludes all those edge cases, i.e. the value is guaranteed to be an integer.