How does basic object/function chaining work in javascript?
问题 I'm trying to get the principles of doing jQuery-style function chaining straight in my head. By this I mean: var e = f1('test').f2().f3(); I have gotten one example to work, while another doesn't. I'll post those below. I always want to learn the first principle fundamentals of how something works so that I can build on top of it. Up to now, I've only had a cursory and loose understanding of how chaining works and I'm running into bugs that I can't troubleshoot intelligently. What I know: