3
My doubt is related to the behavior of a variable, since it is assigned a dynamic value in it.
For example in the code:
var x_position = window.getComputedStyle(elemento).marginLeft;
Doubt: every time I have to read the variable x_position
, it will fetch again the most updated value of window.getComputedStyle ? Or this reading is done only once?
My question is specific to ES5 because in 6 we already have the constants.
I added another example to simulate what you want. It doesn’t change the answer but you can use more or less as suggested in the question.
– Sergio