SHARE
TWEET

Untitled

a guest Jul 17th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top