Created
October 30, 2016 04:50
-
-
Save danielborowski/b154a89461bf33e39a1c10de7cd58442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} | |
console.log(foo("abcdefghi")); // => Uncaught TypeError: str is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment