Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

dojo

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.

like image 981
Vijin Paulraj Avatar asked Sep 05 '13 06:09

Vijin Paulraj


1 Answers

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.

like image 98
0xc0de Avatar answered Oct 13 '22 17:10

0xc0de