var node = someHtmlElement
function formatNode() {
let node = node.cloneNode(true)
// do some stuff with node
return node
}
I would expect this function to first use global node variable then do stuff with the clone.But this throws error "Cannot access 'node' before initialization". Why can't js first use the existing global variable inside the function?