Javascript – Which function is executed if both has same variable names n declared?
let foo = function(){ console.log(1); } setTimeout (foo,1000); foo = function(){ console.log(2); } I got the output as 1. But I need to know why because let can be reinitialized so its correct over here why didn't I get the…