62

For my fellow javascript devs:

var floored = 12.68 | 0;

Is much faster than:

var floored = Math.floor(12.68);

And in both cases floored === 12
#JustJavascriptThings ¯\_(ツ)_/¯

Source: http://stackoverflow.com/questions/...
Performance test: https://measurethat.net/Benchmarks/...

Comments
Add Comment