The always reliable fall that will surely work. For loops are a basic concept in programming. Pay special attention how this loop counts down instead of up.
Reverse and array
Fancy Arrays things
While we create an array from our string we might as well use a more functional approach in the sense that we can use reduce to create a new string from the array.
Ahh the height of programming: recursion. Where every Computer Science student gets to experience a stack overflow and popular websites get their name.
As always in programming you have many ways to solve the same problem. At an interview the fanciness of your code will come down to your nerves as well as proficiency at the language you use. So if in doubt make up methods things have and fall back on for loops 😉⬅️ Go back