Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 296 Bytes

logic-reverse.md

File metadata and controls

9 lines (6 loc) · 296 Bytes

Question

a && b not always equals to !(!a || !b) in javascript

Solution

For example, we can't reverse config && config.field to !(!config || !config.field), Because if config is undefined(which is the purpose of config && config.field), config.field will throw exception