javascript check if string ends with
"Hello world".endsWith("world");//true
"Hello world".endsWith("Hello");//falsefunction endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
endsWith("hello young man","man");//true
endsWith("hello young man","boy");//false
function isJS(path) {
return /jsx?$/.test(path)
}
Also in JavaScript:
- how to push string into array in javascript
- get browser timezone javascript
- jquery get value radio by name
- select first option in dropdown jquery
- import checkbox material ui
- new function javascript
- javascript sort
- react mui icons
- movable gui javascript
- use of eventemitter in angular
- react html symbol code
- js filter text
- javascript get last word in string
- js Property Assignment delete
- what data type is a {} i njs
- javascript boolean regex match
- how to use react fragment
- node pg array in
- fluter class constructor
- jquery remove keypress event
- mongoose database pooling
- javascript save data to local storage
- pegar qual domínio eu estou javascript
- multiple path name for same navlink