A note about template literals

Coming from python JS template literal syntax was new to me. This part of the otherwise fantastic tutorial threw me off, because I did not immediately notice the backticks. Like: "Oh, that's an interesting concept. But it doesn't work. Bummer."
Took me a while to figure.
pull/6806/head
Dominik Leicht 5 years ago committed by GitHub
parent fffe8c16b7
commit 5d4a2e65fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,6 +8,8 @@ We're not limited to declaring reactive *values* — we can also run arbitrary *
$: console.log(`the count is ${count}`); $: console.log(`the count is ${count}`);
``` ```
> Did you notice we are using [template literal syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals "MDN Web Docs") here? `the count is ${count}` is enclosed by `` ` `` backticks, **not** `'` quotes. This enables us to substitute it with reactive declarations, `${count}` for example.
You can easily group statements together with a block: You can easily group statements together with a block:
```js ```js

Loading…
Cancel
Save