This is a neat little project and all but what is the value proposition? The JS console of any modern browser is much more feature-full.
Notice it doesn't give you the correct value.
Fix the square function to correctly return `n*n`. Everything updates instantly.
There's your answer. It's actually really neat to code that way, especially with a long chain of logic.