← Back to challenges

Apples and Bananas

JavaScriptHardstringslanguage_fundamentals

Instructions

Write a function, .vreplace() that extends the String prototype by replacing all vowels in a string with a specified vowel.

Examples

"apples and bananas".vreplace("u") ➞ "upplus und bununus"

"cheese casserole".vreplace("o") ➞ "chooso cossorolo"

"stuffed jalapeno poppers".vreplace("e") ➞ "steffed jelepene peppers"

Notes

  • All words will be lowercase.
  • "Y" is not considered a vowel.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Mini Peaks