āœ”||šŸ¤¢ Commit or Vomit | nested ternary operator

jmdejager

šŸ¤šŸ„‡ Jasper de Jager

Posted on May 4, 2021

āœ”||šŸ¤¢ Commit or Vomit  | nested ternary operator

The ternary operator

It's a delight to use them but should we use them as much as possible? what do you think about the next example? āœ”||šŸ¤¢

H = (C == 0 ? null :
    V == r ? (g - b) / C :
    V == g ? (b - r) / C + 2 :
             (r - g) / C + 4
    );
Enter fullscreen mode Exit fullscreen mode

nested ternary operators āœ”||šŸ¤¢?

ā¤: Commit (I'd commit something like this)
šŸ·: Vomit (we all know unicorns don't vomit)
šŸ¦„: Like your post please continue this series!

Let's vote! šŸ˜Š

Photo by Science in HD on Unsplash

šŸ’– šŸ’Ŗ šŸ™… šŸš©

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related