4. Write a JavaScript function that accepts a string as a parameter and find the word from the string that ends with a particular character. ( for example identify the string end with the character s).
Example 1: javascript endswith
"Hello world".endsWith("world");//true
"Hello world".endsWith("Hello");//false
Example 2: how to find out what a string ends with in javascript
function isJS(path) {
return /jsx?$/.test(path)
}