Two spaces before each line in the code block. HN doesn't use markdown, it's easy to do even on mobile, a demonstration:
function example(measurement) {
console.log(calculation); // undefined - accessible! calculation leaked out
console.log(i); // undefined - accessible! i leaked out <snip>
It's "leaking" because the variable is in scope, it's associated value is "undefined". This is different than with let/const where the variable would not be in scope at that point in the function. An undefined value bound to a variable is not the same as "I have no idea what this thing is". That would be the reference errors seen with let/const.
Thanks for the tip, and also thanks for the explanation. I understand what’s going on here now. Much appreciated