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 130 views
1 answer 137 views
1 answer 182 views
1 answer 169 views
1 answer 163 views
1 answer 148 views
1 answer 144 views
...