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 127 views
1 answer 134 views
1 answer 171 views
1 answer 165 views
1 answer 155 views
1 answer 140 views
1 answer 138 views
...