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'?
Let's try to keep the w3schools references to a minimum please...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Object_everything
To complement the info provided by Kamilius.
http://www.w3schools.com/Js/js_object_definition.asp
Hi karlpokus. The thing is, that in javascript literally everything is an object
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?
Hm. Could you say why?
Yes.
The first parameter of the apply is used to define the value of the "this" in the function.
You can read more in the following link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply
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?
This comment is hidden because it contains spoiler information about the solution
Hmm. So it's kinda of a for in loop thingy?
This comment is hidden because it contains spoiler information about the solution
Loading more items...