3 ms·
This is in general a good advice for most languages; instead of calling a function multiple times, do it once (and potentially store the result if you want it f
by why-el 13y ago
This is in general a good advice for most languages; instead of calling a function multiple times, do it once (and potentially store the result if you want it for later use). A similar, albeit far more simple, example would be calling a length method when iterating over an array instead of saving it to a variable.