How to check whether an array contains a string in JavaScript

1 Answer

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

 



answered Feb 5, 2022 by avibootz
...