Tell us what’s happening:
Hi, im new to programming and just dont get why i should use IIFE to create a module if
the result is the same without IIFE?
Your code so far
let isCuteMixin = function(obj) {
obj.isCute = function() {
return true;
};
};
let singMixin = function(obj) {
obj.sing = function() {
console.log("Singing to an awesome tune");
};
};
let funModule = {
isCuteMixin: function(obj) {
obj.isCute = function() {
return true;
};
},
singMixin: function(obj) {
obj.sing = function() {
console.log("Singing to an awesome tune");
};
}
}
let test = {};
funModule.singMixin(test);
test.sing();
let arr = [];
for(let props in test) {
arr.push(props);
}
console.log(arr)
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
.
Challenge: Use an IIFE to Create a Module
Link to the challenge: