Vijin Paulraj
Vijin Paulraj

Reputation: 4648

Difference between dojo.mixin() and dojo.extend()?

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.

Upvotes: 5

Views: 1547

Answers (1)

0xc0de
0xc0de

Reputation: 8317

From 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.

Upvotes: 6

Related Questions