Skip to content

Instantly share code, notes, and snippets.

@JdeJ
Created November 29, 2018 22:36
Show Gist options
  • Save JdeJ/f910da420b2edd51da9af658028cbd4a to your computer and use it in GitHub Desktop.
Save JdeJ/f910da420b2edd51da9af658028cbd4a to your computer and use it in GitHub Desktop.
/**************************
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