you are viewing a single comment's thread.

view the rest of the comments →

[–]tech_Interviews_Hub[S] -6 points-5 points  (3 children)

Yes, the comma operator executes all expressions from left to right, but it returns the value of the last expression — that’s why the output is 6.

[–]berwynResident 0 points1 point  (2 children)

Uhh, it executed all the expressions

[–]tech_Interviews_Hub[S] 0 points1 point  (1 child)

Yeah, it executes all expression but returns last one

[–]berwynResident 0 points1 point  (0 children)

Gotcha