Mexican Wave
Instructions: In this simple Kata your task is to create a function that turns a string into a Mexican Wave. You will be passed a string and you must return that string in an array where an uppercase letter is a person standing up. Rules: The input string will always be lower case but maybe empty. If the character in the string is whitespace then pass over it as if it was an empty seat Example: wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"] Thoughts: I decided to play around with strings at this challenge and use the replace() function to change the lower case letter to the upper case based on the index. 1st Attempt: Output: As you can see the code works great on the codewars input, but on the hello fails. This is a CodeWars Challenge of 6kyu Rank (https://www.codewars.com/kata/58f5c63f1e26ecda7e000029/train/javascript)

Instructions:
In this simple Kata your task is to create a function that turns a string into a Mexican Wave. You will be passed a string and you must return that string in an array where an uppercase letter is a person standing up.
Rules:
The input string will always be lower case but maybe empty.
If the character in the string is whitespace then pass over it as if it was an empty seat
Example:
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
Thoughts:
- I decided to play around with strings at this challenge and use the replace() function to change the lower case letter to the upper case based on the index.
Output:
As you can see the code works great on the codewars input, but on the hello fails.
This is a CodeWars Challenge of 6kyu Rank (https://www.codewars.com/kata/58f5c63f1e26ecda7e000029/train/javascript)