This question has already been answered:
- && and || with different data types 3 responses
Friends, the question is:
console.log({a:"a"} && {b:"b"}); // {b:"b"} why the operator "&&" with objects results in an object and why the second?
This question has already been answered:
Friends, the question is:
console.log({a:"a"} && {b:"b"}); // {b:"b"} why the operator "&&" with objects results in an object and why the second?
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
in this case, && works like if
learn.javascript.ru -> Logical Operators-> Operator And
Source: https://ru.stackoverflow.com/questions/892390/
All Articles