filmov
tv
How to reverse a String in JavaScript Tutorial

Показать описание
Other videos in the JavaScript Snippets series:
Don’t forget to subscribe to the Junior Developer Central channel for more videos and tutorials!
Whilst it’s not the most common of tasks to do as a Junior Developer, finding out how to reverse a string in JavaScript is handy to know as it introduces you to a few new concepts in terms of handling arrays.
But wait!? A string isn’t an array!
In the tutorial you’ll learn how to do exactly this by using the split() function on the original string and then using the join() function to re-assemble it once it’s been reversed.
You’ll see that this process is very simply however sometimes you’ll be asked (perhaps at a job interview) how to reverse a string in JavaScript without using reverse method. In this instance, the interviewers are checking you can handle basic algorithmic challenges without relying on inbuilt functions.
So, in order to learn how to reverse a string in JavaScript without using reverse method, in the video we’ll discuss how to reverse a string in JavaScript with for loops. Whilst this isn’t the most elegant of ways to do it, it is fairly straightforward and it’s always good to know different ways of accomplishing the same task. Channel Handle @codebubb
Комментарии