let motionModule = {
glideMixin: function(obj) {
obj.glide = function() {
console.log("Gliding on the water");
};
},
flyMixin: function(obj) {
obj.fly = function() {
console.log("Flying, wooosh!");
};
}
};
The challenge suggests that an IIFE be used to create the module. These two pieces of code seem equivalent to me, except the latter is simpler. Why is an IIFE needed? Am I missing something?
Why is an IIFE needed? This module is suppose to teach you about, IIFE.
Of course you don’t have to use it our could use an alternative but, simply knowing of it exsitence could already be of help to you. In case you might end up with a simulair problem that could require IIFE.
I also would recomend you to Google IIFE and look into more options who know what it might be used for some day :3