开发者

Chaining in Javascript

开发者 https://www.devze.com 2023-01-27 08:50 出处:网络
could you please explain me this piece of code? Thank you. items.addItem开发者_高级运维(\"a\").addItem(\"b\").addItem(\"c\").run();

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

精彩评论

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

关注公众号