I am new to Javascript and I'm trying to understand what IIFEs are. I saw the example below on youtube it worked well on the video but when I tried to do the same thing I got an error like
Uncaught TypeError: 4 is not a function
the code:
var a = 4
(function(){
var a = 5
console.log(a)
})()
console.log(a)
I searched google but I couldn't find an answer.