Parent.age se estableció en 20 , por lo que sobrescribirá " this.age = 5 " de la función principal y luego quiero pasar this.age con el valor de 20 a la función secundaria, por lo que la salida del registro de la consola debería ser ( parent 20 años )
function parent(){ this.age = 5 // this age will overwrite by 20 and then should be passed to the child function function child(event){ console.log("parent Age", this.age) // <- the output should be "parent Age 20" } window.addEventListener('click',child) } parent.age = 20 parent() console.log(parent.age) // output -> 20