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

How to use both && and ! together

I wrote it like this console.log( x &&! y );
for || this caseI wrote it like this (x ||! y);
by

1 Answer

sam5epi0l
It seems like you want to use the logical AND (&&) and logical NOT (!) operators together in JavaScript. Your usage is almost correct, but you should add spAces to make your code more readable. Here's the correct way to use them:


x && !y
x || !y

Login / Signup to Answer the Question.