More Solutions to Javascript Reverse String Problem

I just started the Udemy course “The Coding Interview Bootcamp” by Stephen Grider.  I have five solutions below for the reverse string problem in Javascript.  The first three solutions I was already comfortable with.  I never actually used the for…of loop, however.  Grider recommends using it when possible in interviews as there is less room for typos and simple errors than with a traditional for loop.  I tried using the reduce() method before, but never completely understood it.  Grider explains it as reducing an array into a single item or value.  It makes a lot more sense now.

 

Leave a Reply

Your email address will not be published. Required fields are marked *