Message from JavaScript discussions

February 2019

— But it is so fast that i cannot see?


Yes, that function will execute when your button is clicked. But you’re also assigning x a function.

— X can't hold two values right?

— Yes, the browser will wait sometime to get all the changes. So if more changes are executed in the same “time” they will render all together.

Message permanent page

— Kind of, at the same scope no. But if they’re in different scope they will be different variables with the same name.

Message permanent page

— Hey Christian but my code is working out just fine like my function should be called two times, right?

Message permanent page

— So when i am calling it for button 3, it should be called for the default value also

— And the final result would be of default value

— But result for button 3 is being displayed

— Can you explain why is this happening?

— Button 3 is executing logic(6)

— Use different button for default Akshat Pandey