3 ms·
Evaluating constant expressions at compile time is something any good compiler will do. It's not bad practice to write something like "60 * 60" in code instead
by mikeash 10y ago
Evaluating constant expressions at compile time is something any good compiler will do. It's not bad practice to write something like "60 * 60" in code instead of 3600, if the underlying computation is important. At the same time, performing a multiply at runtime is unnecessary and wasteful. This just gives you in JavaScript what any decent C compiler has been doing for ages.