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
Смотрите видео Conquer the JavaScript Interview: Integer Reverse [Beginner Skill Level] онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Covalence 02 Декабрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 178 раз и оно понравилось 6 людям.