Five Tips to Write Better Conditionals in JavaScript: scotch.io/tutorials/5-tips-t…
Oct 1, 2018 · 10:32 AM UTC
IMHO, 4th approach is not efficient, because there is must discussion between strong and lazy initialization.
If you use *switch*, in this manner you allocate values in memory and use when you need, and after work done, they will be destroyed by GC.
In case of *cache* – not.
40%Agree
60%Disagree
15 votes • Final resultsIt's a pity that performance was not included in "what's better". For example it seems to me that if's are faster than include. jsperf.com/array-includes-vs…







