Answers for "how do i remove all vowels from a string in javascript and return the result"

1

how do i remove all vowels from a string in javascript and return the result

function disemvowel(str) {
  var strArr = str.split('');
  for (var x = 0; x < str.length; x++) {
    var char = str[x].toLowerCase();
    if (char == "a" || char == "e" || char == "i" || char == "o" || char == "u") {
      strArr[x] = '';
    }
  }
  return strArr.join('');
}
Posted by: Guest on May-27-2021
0

remove vowels from string javascript

var strings = ["bongo drums", "guitar", "flute", "double bass",
               "xylophone","piano"];
string = strings.map(x=>x.replace( /[aeiou]/g, '' ));
console.log(string);
Posted by: Guest on May-06-2020
2

remove vowels from string javascript

str = str.replace( /[aeiou]/ig, '' )
Posted by: Guest on November-25-2020

Code answers related to "how do i remove all vowels from a string in javascript and return the result"

Browse Popular Code Answers by Language