How check if a variable does not equal either of two values in TypeScript

1 Answer

0 votes
const a = 'typescript';
const b = 'c';
const c = 'php';

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

    
     
     
     
/*
run:
     
"not equal"
     
*/

 



answered Jun 24, 2022 by avibootz
...