top | item 10528247

(no title)

ahoge | 10 years ago

That's string interpolation. That line writes either "00" or "01". It's essentially the same as `'0' + state`.

  'x: $x, y: $y'
is a lot easier to type than:

  'x: ' + x + ', y: ' + y
I actually had to triple check that line. Concatenation is very error-prone. I often mess it up.

String interpolation is a fairly popular feature nowadays:

https://en.wikipedia.org/wiki/String_interpolation

discuss

order

No comments yet.