How to check if variable is not equal multiple values in Node.js

1 Answer

0 votes
const a = 'node.js';
const b = 'c';
const c = 'c++';
const d = 'c#';


if (a !== b && a !== c && a !== d) {
  	console.log('not equal');
} else {
  	console.log('equal');
}

    
     
     
     
/*
run:
     
not equal
     
*/

 



answered Jun 24, 2022 by avibootz

Related questions

...