16
Comments
  • 0
    Could be the feed algorithm. I'm pretty sure I saw the second post in that picture before the first one... On my feed of course.
  • 0
    These rants were posted by the same guy.
  • 2
    @kerrermanisNL Why? I think it's a valid question to test junior devs' understanding of conditional statements.
  • 1
    @setyadi Plus it has been found to work. Even "senior" developers have given crazy answers to it.
  • 0
    @psudo This is mainly the thinking behind it.

    It's not necessarily a hard task, but it certainly demonstrates the thought process of the person doing it.
  • 2
    Okay am i the only one who thinks thats wrong? Just use if()fizz and if()buzz and it will do exactly that, you dont need an if()fizzbuzz part.
  • 0
    @RazorSh4rk It's true, but that's showing you aren't at a beginner level anymore.

    Also looking at it again, it has a small error as the loop should start at 1.
  • 2
    the FizzBuzz is only meant to separate those who can't code <i>at all</i>, from the rest.
    by no means, it's there to evaluate your skills.
    its like 2 levels below beginner, just good enough to dispel a good amount of "programmers"...
  • 2
    This is 3 lines of code but devRant is a small space so the formatting looks weird, but this is how i normally would do fizzbuzz

    for (var i = 1; i < 101; i++) {
    console.log( (i % 3 == 0 ? ( i % 5 == 0 ? "FizzBuzz" : "Fizz" ) : ( i % 5 == 0 ? "Buzz" : null ) ));
    }
  • 1
    @alexdovzhanyn Maybe I'm just not familiar enough with js, but it looks like you're missing the printing out of numbers that aren't fizz or buzz.
  • 2
    @psudo oh shoot youre right! i print out null instead cause i didnt read the instructions 😂😂😂😂 if you replace the null with "i", itll work like expected
  • 0
    @alexdovzhanyn Need to get rid of those brackets too ;) one linerz fo dayz.
Add Comment