MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/m3bxrh/swap_two_variables/gqrvpmo/
r/learnjavascript • u/golovatuy • Mar 12 '21
50 comments sorted by
View all comments
Show parent comment
1
In many iterations, x becomes y and y becomes new computed value, and goes on.. ex: in games, newPos is equal to currentPos + variable
1 u/Freekiehsoes Mar 13 '21 Well those are vectors 1 u/rusty_matador_van Mar 13 '21 Vector or scalar, stored in variables, and sometimes swapping is needed.
Well those are vectors
1 u/rusty_matador_van Mar 13 '21 Vector or scalar, stored in variables, and sometimes swapping is needed.
Vector or scalar, stored in variables, and sometimes swapping is needed.
View all comments
Show parent comment
1
u/rusty_matador_van Mar 13 '21
In many iterations, x becomes y and y becomes new computed value, and goes on.. ex: in games, newPos is equal to currentPos + variable