It's not you :), I think it's just an error, should be:
"3 - elonTrashCan.items is accessible, so the elonTrashCan.isEmpty() call will returns FALSE"
Class properties are public by default. developer.mozilla.org/en-US/docs/W...
Closure doesn't expose 'items', but class does and this is the big difference explained in the article.
Actually, elonTrashCan.isEmpty() returns false as TrashCan is a Module and not a Class. You can read more about it at the related and cited post about Closures
You could also run the test code and see it running.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"Actually something very strange happens:
elonTrashCan.isEmpty() returns false because our internal items are empty"
Is it me or elonTrashCan.isEmpty() returns true?
It's not you :), I think it's just an error, should be:
"3 - elonTrashCan.items is accessible, so the elonTrashCan.isEmpty() call will returns FALSE"
Class properties are public by default. developer.mozilla.org/en-US/docs/W...
Closure doesn't expose 'items', but class does and this is the big difference explained in the article.
As I mentioned in another reply, I'm not actually using
Classes
. What you said is correct forClass
😄Hey! Thanks for your reply!
Actually,
elonTrashCan.isEmpty()
returnsfalse
asTrashCan
is a Module and not a Class. You can read more about it at the related and cited post about ClosuresYou could also run the test code and see it running.