Chaining in Javascript
could you please explain me this piece of code? Thank you.
items.addItem开发者_高级运维("a").addItem("b").addItem("c").run();
It's an example of a fluent interface.
Not sure what framework you're using, but the addItem method returns the parent instance (return this
), so you can call another method upon the output.
精彩评论