Skip to main content

endsWith

_.endsWith(target, string) # Ⓢ [Ⓣ][1] Ⓝ

Checks if string ends with the given target string.

Since​

3.0.0

Arguments​

  1. target (string): The string to search for.
  2. string (string): The string to inspect.

Returns​

(boolean): Returns true if string ends with target,



else false.

Example​

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

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

_.endsWith(['b', 2], 'abc');
// => true