IIFE: function property error

Tell us what’s happening:
I solved the challenge “Use IIFE to create a module” by doing like (see Your code so far part).
I try to test the new module but I’m facing the property error TypeError: Cannot set property 'sing' of undefined
Any Idea, how to solve this issue?
Thanks

  **Your code so far**
let funModule = ( () => {
  return {
    isCuteMixin: (obj) => {
      return true;
    },
    singMixin: (obj) => {
      obj.sing = () => {console.log("Singing to an awesome tune");}
    }
  }
})();
let myModule = funModule;
console.log(myModule.isCuteMixin());
console.log(myModule.singMixin());
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36.

Challenge: Use an IIFE to Create a Module

Link to the challenge:

let funModule = ( () => {
  return {
    isCuteMixin: () => {
      return true;
    },
    singMixin: () => {
       {console.log("Singing to an awesome tune");}
    }
  }
})();

I changed your code just slightly, but you’ll noticed in your original draft,

singMixin: (obj) => {
      obj.sing = () => {console.log("Singing to an awesome tune");}
    }

as you can see what your singMixin actually does in this case is set the property of sing to the argument obj, but you never hand in obj which was the right thing to do as it was now obsolete, but you probably did not realize it was the cause of the error as it does not fail the test, but that is why it is undefined as you are setting sing onto nothing

Thanks @caryaharper .
I had “undefined” output after console.log ().
I added the return “” to avoid it. Does it correct?

singMixin: () => {
       {console.log("Singing to an awesome tune"); return '';}
    }

You should allow it to return undefined , undefined is simply the output of a void function in JavaScript. Some functions will not have a return value, and in JavaScript it is understood that it will return undefined, by returning an empty string you are conveying more meaning than you intend. If you want to say something has no value with intent than make its value null although this is not what you should do for a void function.