S
S
svilkov872018-03-20 14:53:02
JavaScript
svilkov87, 2018-03-20 14:53:02

How to form a condition with a logical operator?

Hello!
Changed the question a bit. You need to get the condition not with AND, but with OR.
There is an object:

var obj = {
    one  :  true,
    two  :  true
  };

How to form such a condition:
If there is one in the object OR one is not equal to false, then output something to the console?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AskJs, 2018-03-20
@svilkov87

if (obj.one || obj.one !== false)
console.log("test")
&& - and
|| - or

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question