How to use includes method ignoring the case in Node.js

1 Answer

0 votes
const str = "node.js php java c c++";

const substr = 'JAVA';

console.log(str.toLowerCase().includes(substr.toLowerCase()));
    
    
    
    
/*
run:
    
true
    
*/

 



answered Jul 12, 2022 by avibootz

Related questions

1 answer 131 views
1 answer 121 views
1 answer 110 views
1 answer 122 views
1 answer 156 views
2 answers 165 views
1 answer 127 views
...