gpt4 book ai didi

dojo - dojo.mixin() 和 dojo.extend() 的区别?

转载 作者:行者123 更新时间:2023-12-04 18:43:50 26 4
gpt4 key购买 nike

我是 Dojo Toolkit 的新手,今天我遇到了这个话题 dojo.mixin()dojo.extend() .
我想两者都习惯于从另一个对象获取一个对象的属性。

谁能解释一下 dojo.mixin() 之间的区别和 dojo.extend() ?

编辑:阅读 Dojo 文档后,我很清楚 dojo.extend()用于处理对象的原型(prototype)。

最佳答案

来自 dojo docs

Mixin combines two objects from right to left, overwriting the left-most object, and returning the newly mixed object for use. mixin() is very similar to extend() but only works on objects, whereas extend explicitly extends an object’s prototype.

关于dojo - dojo.mixin() 和 dojo.extend() 的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18628817/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com