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.
In case someone tries to run digits.substr(0, 5) on nodejs it won't work directly, instead convert it to a string: digits.toString().substr(0, 5)
Why Intl.NumberFormat() is not accept?
This comment is hidden because it contains spoiler information about the solution
Update: I downloaded Firefox 29 on OS X, typed +"0" in the console and it returned 0
To double chech I copied the whole function and run it like this: sortDict({1:5,3:10,b:2,6:3,0:8})
The "0" was returned as a string in the array.
So now I see that if we define "0" in a variable zero and then compare +zero || zero it returns "0" and that is the case even in the newest browsers and on Node 5.1
As pointed in another answer, the best way to do it is >> isNaN(k) ? k : +k
The way I tested this on Node 5.1 and Chrome 48 it worked fine. I tried +"0" and it returned 0
Do you think this because the V8 engine in the newest version of Node and Chrome use ECMAScript6?