How to check if string contains specific character in Node.js

1 Answer

0 votes
const str = 'node.js c c++';
const ch = 's';

console.log(str.includes(ch)); 
console.log(str.includes('N')); 




/*
run:

true
false

*/

 



answered Feb 6, 2022 by avibootz
edited Feb 6, 2022 by avibootz
...