API Reference

Returns a boolean of whether or not the first string starts with a specific prefix or one of several prefixes.

function startsWith(str: string, suffix: string | string[]): boolean

// Example:

startsWith("hello world", "hel") //=> true

startsWith("hello world", ["sdf", "hel"]) //=> true