DEV Community

Discussion on: Why do we write JavaScript like this?

 
anders profile image
Anders

I'm not entirely sure I follow, how would that look?

I do agree in principle though re: complexity. I could have spent some more time on my counter examples for sure.

Thread Thread
 
brandinchiu profile image
Brandin Chiu • Edited

Oh woops!

I've misinterpreted what this is doing; I thought I saw an else statement in your if.

That's definitely my bad -- ignore my comments about Cyclomatic Complexity. They don't apply here.

Thread Thread
 
anders profile image
Anders

Roger that, I thought you had some extra magic in store there and got way intrigued : )