Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to compare a string with its ending in javascript

function solution(str, ending){
  return str.indexOf(ending, str.length - ending.length) !== -1;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: mongoose virtual populate paginat 
Javascript :: react $ r component instance console 
Javascript :: str_word_count php js 
Javascript :: adjust() js 
Javascript :: angular http call caching issue even after no-cache 
Javascript :: react native app slow lagging image 
Javascript :: react native scrollview fixed header 
Javascript :: how to copy from js the lines of an html 
Javascript :: how to use getBackgroundPage 
Javascript :: jQuery exclude exteranl link for images 
Javascript :: convert json in parse inputs azure function 
Javascript :: get foco a div 
Javascript :: deconstruction javascript check if exist attrib 
Javascript :: adding growl delete notifications in vanilla js 
Javascript :: rest operator javascript 
Javascript :: jQuery Aniview 
Javascript :: customize please select some product options before wordpress message 
Javascript :: How to get length of string in javascript without using native length method 
Javascript :: how display same paragraph in all pages of website in js 
Javascript :: angular 4200 on ec2 access is localhost 
Javascript :: react buttons npm 
Javascript :: resequency array by atributo 
Javascript :: prevent specific state redux-persist 
Javascript :: nodejs createcipheriv invalid key length 
Javascript :: jszip file bufer 
Javascript :: removeeventlistener not working in class javascript 
Javascript :: how to get the data from clicking on notification on web in reactjs 
Javascript :: media query for mobile in react file 
Javascript :: javascript loop 2 
Javascript :: javaScipt diference != and !== 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =