JavaScript String endsWith()
JavaScript String endsWith()
The endsWith() method is used to return true if a string ends with a specified string else it will return false. This method is case-sensitive.
Syntax:-
Its syntax is:- string.endsWith(searchvalue, length)
Return:-
Its return is:- true if the string ends with specified value else false.
Further Explanation:-
Parameter | Description |
searchvalue | Required. The string to search for. |
length | Optional. The length of the string to search. By default, its value is the length of the string. |