Skip to content

Instantly share code, notes, and snippets.

@danielborowski
Created October 30, 2016 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielborowski/470a1d13c752bbe92e274955eb4983eb to your computer and use it in GitHub Desktop.
Save danielborowski/470a1d13c752bbe92e274955eb4983eb to your computer and use it in GitHub Desktop.
// this function is supposed to take in a string and return
// a new string with all the vowels removed
function removeVowels(str) {
var result = "";
var ignore = ['a', 'e', 'i', 'o', 'u'];
for (var i = 0; i < str.length; i++) {
if (ignore.indexOf(str(i)) === -1) {
result += str(i);
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment