How check if a variable does not equal either of two values in Node.js

1 Answer

0 votes
const a = 'node.js';
const b = 'c';
const c = 'python';

if (![b, c].includes(a)) {
  	console.log('not equal');
} else {
  	console.log('equal');
}

    
     
     
     
/*
run:
     
not equal
     
*/

 



answered Jun 24, 2022 by avibootz
...