© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Mayank Chandola
salary variable inside the IIFE will be hoisted so it's value will be undefined at the first console.log
undefined
console.log
For simplicity you can run this in your console.
var a=5; function x() { console.log(a); var a=3; } x();