Yes, this is valid Javascript. It uses a comma operator, which simply evaluates the expression on the left, then the one on the right, and returns the value of the value pointed to the right.
Since the expressions "My message"
and x-coord
have no side effects, this is the same as:
context.fillText = y-coord;
Or:
"My message"; // Does nothing x-coord; // Does nothing context.fillText = y-coord;
source share