Fizzbuzz in JavaScript Explained Simply

preview_player
Показать описание
Fizzbuzz is one of the most famous beginner algorithms. It's also great for showing you one of the main uses of the modulus operator , % . You should definitely know how to solve this one for job interviews!
If you want to become a developer, then you need to be able to come up with solutions to problems. In this series I teach the algorithms that you'll be expected to know.
Рекомендации по теме
Комментарии
Автор

POV : You're watching this during middle of an interview.

ImHansana
Автор

Thanks for this.. I was unsure of myself but this helped a lot.. Keep up the great work.

dendrxx
Автор

I solved it first using string concatenation instead of if-elses, but now i think this way is probably better.

RoadToFuture
Автор

I don't think you know how the modulus operator works...
1%2 and 3%2 are both equal to 1, not 0.5 and 1.5

DarkLightning
Автор

Wasn't it easier just to write i % 6 === 0 for when the number is divisible with 3 and 2? But great explanation!

join shbcf.ru