开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜