if string ends with code example
Example 1: javascript endswith
"Hello world".endsWith("world");//true
"Hello world".endsWith("Hello");//false
Example 2: endswith()
var str = "Hello world, welcome to the universe.";
var n = str.endsWith("universe.");//returns true
Example 3: how to find out what a string ends with in javascript
function isJS(path) {
return /jsx?$/.test(path)
}