Good job.
Seeing as you have passed this challenge with your current code, I would now suggest you try solving it again using a more programmatic approach.
If you look at the hint page (you do not have to look at the solutions) you will see two methods mentioned. Look at MDN for the string methods and see if you can figure out how they might be useful for solving this challenge.