DEV Community

Discussion on: Avoid use IF on our JS scripts

 
uuykay profile image
William Kuang

If you've ever had to write a conditional in Microsoft Excel, you'll be familiar with this. Check out this article to see what I mean: exceljet.net/excel-functions/excel....

Excel doesn't have if/else if statements, it only has if/else which is the same as a ternary. Do you really think reading this is easier?
=IF(C6<70,"F",IF(C6<75,"D",IF(C6<85,"C",IF(C6<95,"B","A"))))

Thread Thread
 
damxipo profile image
Damian Cipolat

It is just a proposal, for me an excel formula is just as ugly as an if..else..elseif with nesting.