Closed thiloplanz closed 13 years ago
In this case, you're using stack before you've defined it (which should explode). I think reversing those two lines would fix it...? That said, I should put a section in the docs on chaining. What it is, and what sorts of methods support it (usually everything but getter methods).
Sorry for the bad example, those two lines were supposed to be unrelated to each other. Reversing them does not fix the problem, I think. The problem being that neither push
nor setStack
(and probably others as well) return their respective this
.
Ah! Got it. I'll do another chaining pass as part of 0.5.0. Thanks!
Not everything is chainable and it is not obvious what is and what is not.
For example, the following does not work (returns
undefined
):