Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const vowelDoubler = function(array) {
  2.  
  3. for (let i = 0; i < array.length; i++) {
  4. let vowel = array[i];
  5. if (vowel === 'a' || vowel === 'e' || vowel === 'i' || vowel === 'o' || vowel === 'u') {
  6. array.splice(i + 1 , 0, 'vowel adds here');
  7. // array.splice(i + 1, 0, vowel)
  8. }
  9. }
  10. return array;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement