Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

About operators

as my opnion this code is true but expected code is differ it says that "
Use the AND and NOT logical operator with x and y correctly in first log statement.

"
let x = true;
let y = false;

// Apply AND operator with NOT on x (Output: true)
console.log(x!=y && x > y);

// Apply OR operator with NOT on x (Output: false)
console.log(y || !x);
by

1 Answer

iamabhishek
Your answer is correct, its just that our system is a little strict. This should work:

let x = true;
let y = false;

// apply AND operator
console.log(x && !y)

// apply OR operator
console.log(!x || y)

Login / Signup to Answer the Question.