4.17.11
3.10.1
2.4.2
1.3.1

_.endsWith([string=''], [target], [position=string.length])

Checks if string ends with the given target string.

Since

3.0.0

Arguments

argument
[string='']
[target]
[position=string.length]
type
string
string
number
description
The string to inspect.
The string to search for.
The position to search up to.

Returns

(array)

Example

_.endsWith("abc", "c");
// => true

_.endsWith("abc", "b");
// => false

_.endsWith("abc", "b", 2);
// => true
_.endsWith("abc", "c");
// => true

_.endsWith("abc", "b");
// => false

_.endsWith("abc", "b", 2);
// => true