I can do either reverse a string or remove vowels, but I have been stuck for a day trying to figure out how to combine them into one function. I know it has to be easy, but my brain is blocking my progress here.
Any assistance would be appreciated!
var strings = ["bongo drums", "guitar", "flute", "double bass", "xylophone", "piano"];
strings = strings.map(function (string) {
return string.replace(/[aeiou]/g, '');
});
console.log(strings);
function reverse(s) {
let i = s.length,
o = '';
while (i > 0) {
o += s.substring(i - 1, i);
i--;
}
console.log(o);
return o;
}
reverse('hello');