Tests if the specified string ends with the specified suffix (or one among several specified suffixes).
Parameters:
str
The string to be tested.
suffix
suffixes
The suffix or an array of suffixes.When an array of suffixes specified, the function returns
true
if the string ends with at least one of them.
Tip:
You may call this function in a method-like style:
str.endsWith(suffix)