Homework for beginners JS

I am not going to give you the solution, but here some hints:

while you loop over the string, you check when you have reached the correct index, and do something

strings are immutable, you can’t change directly the given string, you need to create a new string - also you can’t change the string you are looping over because it will throw up the loop chasing the length of the string so don’t use the same variable for the new string