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.
Thanks for your explanation a lot.
So, what you mean is that 'this' of vasya's method (if passed to the .every() just as vasya.sell) will be bound to the personInLine which, in return, will not have 'money' object inside causing an error?
If so, then I got it. But it took me some time.
Because
vasya.sell
is just the function (Function Object
), unexecuted, unbound.If you want to execute that function with
this
bound tovasya
, you have tobind
it and then later execute it, or execute the function asvasya.sell($something)
in one expression.There is a difference between
.every( vasya.sell )
and.every( personInLine => vasya.sell(personInLine) )
. Maybe there need not have been a difference, but there is. There's something to be said for ( and against ) both possibilities.Why do we need to bind vasya's method 'sell' to vasya?