Checks if string ends with the given target string.
string
5.7.0
includes,startsWith
endsWith('abc', 'c')// => trueendsWith('abc', 'b')// => falseendsWith('abc', 'b', 2)// => true
The string to inspect.
The string to search for.
The position to search up to.
Returns true if string ends with target, else false.
true
target
false
Checks if
string
ends with the given target string.5.7.0
includes,startsWith