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.
We can.
Correct syntax would be
this.valueOf = () => value
.Yes, thank you very much!
why can't we just do:
var Foo = function(value){
this.val=value
return this.valueOf(this.val)
}
or something like that?
This comment is hidden because it contains spoiler information about the solution
Can anyone explain? Thanks :-)
Crafty solution :) I thinked of this way too but ended with another one.
Absolutely right. I've fixed that now, and added the test case to my tests.
Good point. I've added a simple
.toFixed(10)
to compare the numbers, which seems to cover your solutions.It seems that there is a bug in the description - the result of the example should be 0.6(6) not 0.75.
I couldn't stop yourself ;)