How to use includes method ignoring the case in JavaScript

1 Answer

0 votes
const str = "javascript php c c++";

const substr = 'PHP';

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

 



answered Jul 12, 2022 by avibootz

Related questions

1 answer 117 views
1 answer 121 views
1 answer 159 views
1 answer 141 views
1 answer 148 views
1 answer 131 views
1 answer 128 views
...