If in a continuous logical operation, the operation result is already clear before the last operation is completed, then the operation often does not need to continue to be executed, because it will not have any impact on the final result. Influence.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
If in a continuous logical operation, the operation result is already clear before the last operation is completed, then the operation often does not need to continue to be executed, because it has already been There will be no impact on the final result.
true || “cat” Result: true
true && “cat” Result: cat
true && “cat” || true Result: true
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of What is lazy evaluation in javascript. For more information, please follow other related articles on the PHP Chinese website!