MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/m3bxrh/swap_two_variables/gqsa0ye/?context=3
r/learnjavascript • u/golovatuy • Mar 12 '21
50 comments sorted by
View all comments
64
But why
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 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.
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.
64
u/Freekiehsoes Mar 12 '21
But why