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 210 views
1 answer 211 views
1 answer 259 views
1 answer 240 views
1 answer 237 views
1 answer 217 views
1 answer 226 views
...