Checks if a string ends with the given suffix.
The string to check.
The suffix to test.
true if str ends with suffix, otherwise false.
true
str
suffix
false
1.1.0
endsWith("Hello World", "World"); // trueendsWith("Hello World", "world"); // falseendsWith("Hello", ""); // true Copy
endsWith("Hello World", "World"); // trueendsWith("Hello World", "world"); // falseendsWith("Hello", ""); // true
Checks if a string ends with the given suffix.