How to use endsWith method ignoring the case in JavaScript

1 Answer

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

const substr = 'PHP';

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

 



answered Jul 12, 2022 by avibootz

Related questions

1 answer 216 views
1 answer 217 views
1 answer 265 views
1 answer 246 views
1 answer 241 views
1 answer 222 views
1 answer 230 views
...