function openMenu() {
var menu = document.getElementById("menu")
var num = 123
menu.classList.remove("hidden")
}
function closeMenu() {
menu.classList.add("hidden")
console.log(num)
}
https://jsfiddle.net/kn5ateov/
I thought i knew hoisting, now I know, I know nothing. How come the second function has access to the var menu but not the var num?