Fizzbuzz in JavaScript Explained Simply

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • 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.

ความคิดเห็น • 11

  • @dendrxx
    @dendrxx 2 ปีที่แล้ว +1

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

  • @RoadToFuture007
    @RoadToFuture007 ปีที่แล้ว

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

  • @svejdam7106
    @svejdam7106 3 ปีที่แล้ว +1

    Another awesome video :) well done!

    • @doabledanny
      @doabledanny  3 ปีที่แล้ว

      Thanks Martin mate!!

  • @unemployedoat
    @unemployedoat ปีที่แล้ว +1

    good shitfam !

  • @ImHansana123
    @ImHansana123 ปีที่แล้ว +1

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

  •  2 ปีที่แล้ว +3

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

    • @doabledanny
      @doabledanny  2 ปีที่แล้ว +1

      Yeah, I think that would also work. Thanks Marko!

  • @DarkLightning96
    @DarkLightning96 3 ปีที่แล้ว +3

    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

    • @doabledanny
      @doabledanny  3 ปีที่แล้ว +2

      Yeah you are right! 3 % 2 = 1 because 2 goes into 3 once with a remainder of 1.