How can I declare a variable as a function as well as assign values to it

I tried this:

 var fun = function(){ console.log("booyah"} , {
  hell: function(){
    console.log("hello");
  },
  boy: ()=>{
    alert("blah");
  }
};
fun.boy();

I want that first I call fun function and then Access functions I have stored as objects. But I am getting errors . How can I fix it? Or is there any other way to do that?
Please help.

30 thoughts on “How can I declare a variable as a function as well as assign values to it”

  1. What i do not realize is in truth how you are not actually much more smartly-favored than you may be now. You are so intelligent. You realize therefore considerably in relation to this matter, made me in my view consider it from numerous varied angles. Its like women and men are not fascinated unless it is one thing to accomplish with Woman gaga! Your individual stuffs excellent. All the time care for it up!

    Reply

Leave a Comment