Function startsWithOneOf

  • Returns true if str starts with one of the provided strings.

    Parameters

    • str: string
    • strings: string[]

    Returns boolean

    startsWithOneOf('ab', 'a', 'c'); // true
    startsWithOneOf('cc', 'a', 'b'); // false