Created
November 29, 2018 22:36
-
-
Save JdeJ/f910da420b2edd51da9af658028cbd4a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/************************** | |
Is there a vowel in there? | |
**************************/ | |
function isVow(a){ | |
for(let i=0; i<a.length; i++){ | |
switch(a[i]){ | |
case 97: | |
a[i] = 'a'; | |
break; | |
case 101: | |
a[i] = 'e'; | |
break; | |
case 105: | |
a[i] = 'i'; | |
break; | |
case 111: | |
a[i] = 'o'; | |
break; | |
case 117: | |
a[i] = 'u'; | |
break; | |
} | |
} | |
return a; | |
} | |
/************************** | |
List Filtering | |
**************************/ | |
function filter_list(l) { | |
// Return a new array with the strings filtered out | |
let auxArray = []; | |
for(let i=0; i<l.length; i++){ | |
if(typeof(l[i]) === 'number'){ | |
auxArray.push(l[i]); | |
} | |
} | |
return auxArray; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment