How to check whether an array contains a string in Node.js

1 Answer

0 votes
const array = ['c++', 'javascript', 'c', 'java 9', 'node.js'];
 
console.log(array.includes('node.js'));
   
   
   
   
   
/*
run:
   
true 
   
*/

 



answered Feb 5, 2022 by avibootz
...