• Returns whether the given string starts with any of the prefixes

    Parameters

    • Optionaltext: null | string

      the source string to check

    • Optionalprefixes: (undefined | null | string)[]

      the target strings to compare

    Returns boolean

    whether the given string starts with any of the prefixes

    startsWithAny('foobar', ['foo', 'bar']);    // true
    startsWithAny('hello', ['foo', 'bar']); // false