Hacker News new | ask | show | jobs
by ju-st 3881 days ago
Yes, I like it! Only thing I don't understand is '0$state'.
1 comments

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