function sayHi(name){
let result="Hi"+name+a;
console.log(result)
}
let a=1;
sayHi("Alex")
The result of the above code is Hi Alex1, so from what I understand is the variable a is hoisted, but in JS, only the declaration is hoisted, not the initialisation, so how come the result can use the value of a?