5

I'm new to Dojo Toolkit and today I came across the topic dojo.mixin() and dojo.extend(). I guess both are used to acquiring one object's property from another.

Can anyone explain me the difference between dojo.mixin() and dojo.extend()?

Edit: After reading the Dojo documentation I am clear that dojo.extend() is used to work on an object’s prototype.

4

1 回答 1

6

来自道场文档

Mixin 从右到左组合两个对象,覆盖最左边的对象,并返回新混合的对象以供使用。mixin() 与 extend() 非常相似,但仅适用于对象,而 extend 显式扩展对象的原型。

于 2013-09-05T06:29:13.467 回答