Created
April 10, 2017 16:23
-
-
Save daartv/aa5e30b1e7f82f6abb7efa17cb38ee84 to your computer and use it in GitHub Desktop.
Double all the vocals on an array of string characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vowelDoubler = (array) => { | |
for (var i = 0; i < array.length; i++) { | |
if (array[i] === 'a' || array[i] === 'e' || array[i] === 'i' || array[i] === 'o' || array[i] === 'u') { | |
array.splice(i, 0, array[i]) | |
i++ | |
} | |
} | |
return array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment