Menu

Why I am getting the uncaught typeerror: {(intermediate value)} is not a function here.

Reading 0:00
15s threshold
let object = { YoutubeChannel: { name: 'Comicverse', location: 'India,Madhya Pradesh', Domains: { Videos: ['Doctor doom final plan', 'Marvel is faling'], Shorts: ['This is crazy', "Who will appear in Marvel's doomsday"], } } }; (function() { console.log("Hey! this is an immediately invoked function!!"); } )(); 
  1. I asked AI, and it told me something about parsing and all. That is how JS considers that the function is still a part of the object and tries to execute it.
  2. But my concern is that with the use of curly braces, I have explicitly defined their domain.
  3. Why is it that it still needs the semicolon between the object literal and the Immediately Invoked Function Expression

P.S. If you have any suggestions regarding how I can improve the way I ask questions, how to format them, etc., please let me know... :-)

submitted by /u/Several_Box4108
[link] [comments]