DEV Community

Discussion on: Keeping your code clean by sweeping out "if" statements

Collapse
 
december1981 profile image
Stephen Brown

A map or associative array of some kind probably makes heap allocations and has plenty of ifs in its internal implementation. So I would hazard a guess it is probably a lot slower than just using ugly ifs.