Conquer the JavaScript Interview: Integer Reverse [Beginner Skill Level]

Publié le: 02 décembre 2022
sur la chaîne: Covalence
178
6

Link to this Playlist:
   • Conquering the JavaScript Interview  

Previous Video for String Reverse with Native Methods:
   • Conquer the JavaScript Interview: Rev...  

This is a part of my Algorithms and Data Structures playlist series. We cover a lot of common interview questions asked during whiteboards for entry level developers. Learning to master these takes time, practice, and pattern recognition. So I'll be helping you equip a toolbelt and filling it with as many tools as I can to help prepare you crush those interviews! Remember: "Luck is where practice meets opportunity."

In this video we cover an algorithm that isn't something you'd probably do in the real world (like most interview questions lol): integer reverse! The goal is simple, we need a function to accept any negative or positive integer, and return the reversed version of it as a number and maintaining its *sign*. We achieve this by converting to a string, reversing it with a loop or native methods, and then parsing it back to an integer with parseInt(). We can then use an if/else statement testing if the input number is negative, or using the Math.sign() function to determine if our input was indeed a negative number. Happy Hacking! HACK THE PLANET!

Don't forget to like this video and subscribe to our channel – we're publishing more videos and walkthroughs every week. Comment below and let us know what you'd like to see next!

Join the Covalence community: https://covalence.io

Shop Covalence merch: https://covalence.merchntly.com


Sur cette page du site, vous pouvez voir la vidéo en ligne Conquer the JavaScript Interview: Integer Reverse [Beginner Skill Level] durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Covalence 02 décembre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 178 fois et il a aimé 6 téléspectateurs. Bon visionnage!