Created
May 30, 2017 16:51
-
-
Save JacksonRMC/cb1ef2f4c5b1d72b55776b0d8cb3bee3 to your computer and use it in GitHub Desktop.
This file contains 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 doubleVowels = function(array) { | |
var vowels = ['a','e','i','o','u']; | |
for ( var i = 0 ; i < array.length ; i ++) { | |
if ( vowels.includes(array[i]) ) { | |
array.splice(i, 0, array[i]); | |
i ++; | |
} | |
} | |
return array; | |
} | |
var starting = ['w','h','a','t',' ','o','n',' ','e','a','r','t','h',' ','a','r','e',' ','y','o','u',' ','t','a','l','k','i','n','g',' ','a','b','o','u','t','?'] | |
var ending = ['w','h','a','a','t',' ','o','o','n',' ','e','e','a','a','r','t','h',' ','a','a','r','e','e',' ','y','o','o','u','u',' ','t','a','a','l','k','i','i','n','g',' ','a','a','b','o','o','u','u','t','?'] | |
console.log(doubleVowels(starting)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment