repl.it
@mcuringa/

remove-vowels

ES6

#think-js #strings

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function removeVowels(s) {
  let vowels = "aeiou";
  let sansVowels = "";
  for (let i = 0; i < s.length; i++) {
    let c = s[i].toLowerCase();
    if(!vowels.includes(c)) {
      sansVowels += s[i];
    }
  }
  return sansVowels;
}


console.log(removeVowels("CompSci")); // CmpSc
console.log(removeVowels("A dark and stormy night.")); //  drk nd strmy nght.

Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie
?