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.
I'm sure you are all right. JS is very confusing at times. A function can not hold a variabel that 'this' can access right? An object (called through the this keyword) can access it's properties via dot-, or bracket notation. Then what's the point of using a function as the object as you have no use for the 'this'?
Hi Lasfin! Yes. It never returns the value of the ballType argument. Your else statement should be this.ballType = ballType;
Hi hilario! Yes. I know. But can that argument (the object to use as this) be a function? Functions are not objects are they?
Can the function be the object calling the function?
This is not even right?!
Same here. The test could be improved by showing the type.
Cool. Didn't know this. Is it a recommended way of testing keys in objects? or items in arrays? Looks short and sweet. Are there known pitfalls?
Hmm. So it's kinda of a for in loop thingy?
Don't think you need toString
Sweet! But why does this work even if the 2nd arg is a string?
Me too. WTF?
Test Failed: Tested single space, expected "foo bar", but got "foo bar"
Test Failed: Tested multiple spaces, expected "foo bar", but got "foo bar"
Test Failed: Tested line-break, expected "foo\nbar", but got "foo\nbar"
Test Failed: Tested tab, expected "foo\tbar", but got "foo\tbar"
Test Failed: Tested different types of whitespace, expected "foo \t\n \r\n bar", but got "foo \t\n \r\n bar"