input string
search string
substring length (default: str.length)
boolean indicating if the input string ends with the search string
var bool = endsWith( 'Remember the story I used to tell you when you were a boy?', 'boy?' );
// returns true
var bool = endsWith( 'Remember the story I used to tell you when you were a boy?', 'Boy?' );
// returns false
var bool = endsWith( 'To be, or not to be, that is the question.', 'to be' );
// returns false
var bool = endsWith( 'To be, or not to be, that is the question.', 'to be', 19 );
// returns true
var bool = endsWith( 'To be, or not to be, that is the question.', 'to be', -23 );
// returns true
Test if a string ends with the characters of another string.