Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It's a compact way to round a number without without needing to check for negatives and do Math.ceil/floor accordingly. ~~ is clever and useful but not intuitive :) http://stackoverflow.com/questions/4055633/what-does-do-in-javascript has a good writeup of how it works.
num+''
was my first thought, and as you say it's legit... but I went withtoString()
for readability - ie. you can be sure everyone on your team can work out what "toString" is doing, but the other way requires slightly more knowledge of implicit type coercion. To say nothing of this solution... impressive, but your team mates may not appreciate it ;)