lib/haikufy.js
function findIndexOfSyllable(splitArray, syllableNumber, splitRegex){
    let syllableCount = 0; 
    for(let i = 0; i < splitArray.length; i++){
        if(!splitArray[i].match(splitRegex)){
            syllableCount++;
        }
        
        // If we found the desired syllable, return the index
        if(syllableCount === syllableNumber){
            return i;
        }
    }
    
    // No result
    return null;
}
function findIndexOfSyllable(splitArray, syllableNumber, splitRegex){
    let syllableCount = 0; 
    for(let i = 0; i < splitArray.length; i++){
        if(!splitArray[i].match(splitRegex)){
            syllableCount++;
        }
        
        // If we found the desired syllable, return the index
        if(syllableCount === syllableNumber){
            return i;
        }
    }
    
    // No result
    return null;
}
Given an array of split characters, including hyphens and white space, it will return the index in splitArray where the syllableNumber is, or null for invalid. eg: ['I', ' ', 'am', ' ', 'a', ' ', 'horse' ] findIndexOfSyllable(arr, 4) returns 6