EdgeCoders
Published in

EdgeCoders

Coding Tip: Try to Code Without If-statements

You might uncover better solutions

Code from a Facebook project. Please don’t sue them.

Update: This article is now part of my book “Learn Coding with Modern JavaScript”.

Read the updated version of it at jscomplete.com/no-ifs.

When I teach beginners to program and present them with code challenges, one of my favorite follow-up challenges is: Now solve the same

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Samer Buna

Samer Buna

Author for Pluralsight, O'Reilly, Manning, and LinkedIn Learning. Curator of jsComplete.com