I am beginner who thought before doing the String Methods section of the course "You know what, let's test my skills". And boy my skills were tested. After I completed the challenge my jaw dropped, with the solution.

Had/Have this happened to y'all. Where you make something complicated and found out that there was a simple solution?

Solution

Show

My Code

Show

  • MrOzwaldMan@lemmy.ml
    hexagon
    ·
    10 months ago

    (For point 1) Got it, from now on variables will be declared with let. I don't understand what is "use strict"; maybe you can explain it.

    (For point 2) I was testing to see if reversedWord printed the desired output in the Console, forgot to remove it after finishing the program. I also don't understand what 'O(N^2)' and 'O(N)' is, but +=-ing an empty string is a great idea, why didn't i think of that.