src/parser.js
function beginsWith(haystack, needles) {
    let needle;
    for (let i = 0, u = needles.length; i < u; ++i) {
        needle = needles[i];
        if (haystack.substr(0, needle.length) === needle) {
            return true;
        }
    }
    return false;
}
function beginsWith(haystack, needles) {
    let needle;
    for (let i = 0, u = needles.length; i < u; ++i) {
        needle = needles[i];
        if (haystack.substr(0, needle.length) === needle) {
            return true;
        }
    }
    return false;
}
function beginsWith ( haystack , needles ) { let needle ; for ( let i = 0 , u = needles . length ; i < u ; ++ i ) { needle = needles [ i ] ; if ( haystack . substr ( 0 , needle . length ) === needle ) { return true ; } } return false ; }
Tests if a string begins with any of the string in the array of needles.

@param  {string} haystack String to test
@param  {string[]} needles Array of string to look for
@return {boolean} True indicates the string begins with one of the needles.
Tests if a string begins with any of the string in the array of needles .