Checks if a string contains another string at the end of the string.
Checks if one string endsWith another string. Optional position parameter to offset searching before a certain index.
The string that might contain the target string.
The string to search for.
Optional
position: numberAn optional position from the start to search up to this index
const isPrefix = endsWith('fooBar', 'foo') // returns true
const isPrefix = endsWith('fooBar', 'bar') // returns false
const isPrefix = endsWith('fooBar', 'abc') // returns false
const isPrefix = endsWith('fooBar', 'foo', 3) // returns true
const isPrefix = endsWith('fooBar', 'abc', 5) // returns false
Alias