Skip to main content

startsWith

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

Checks if string starts 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 starts with target,



else false.

Example​

_.startsWith('a', 'abc');
// => true

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

_.startsWith(['b', 1], 'abc');
// => true