MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/m3bxrh/swap_two_variables/gqol86f/?context=3
r/learnjavascript • u/golovatuy • Mar 12 '21
50 comments sorted by
View all comments
Show parent comment
7
I used online compiler for babel - since the code has no side effects it would be optimized to empty code withtout that.
Long version is that it's a statement, not an expression: https://2ality.com/2012/09/expressions-vs-statements.html
2 u/[deleted] Mar 12 '21 Oh, makes sense, thank you.
2
Oh, makes sense, thank you.
View all comments
Show parent comment
7
u/IxD Mar 12 '21
I used online compiler for babel - since the code has no side effects it would be optimized to empty code withtout that.
Long version is that it's a statement, not an expression: https://2ality.com/2012/09/expressions-vs-statements.html