The expression _a || []will return _aif it is “true”, otherwise [](it is a short circuit, therefore it evaluates only one of the operands “true” or all of them were evaluated),
This is essentially a null check. If _ait is null or undefined (or false, but this is unlikely in this case), then it is initialized with an empty array.
source
share