chore: avoid backticks

pull/6806/head
bluwy 5 years ago
parent f6bc012ade
commit a1a2ff73ad

@ -2,7 +2,7 @@
let count = 0; let count = 0;
$: if (count >= 10) { $: if (count >= 10) {
alert(`count is dangerously high!`); alert('count is dangerously high!');
count = 9; count = 9;
} }

@ -5,17 +5,15 @@ title: Statements
We're not limited to declaring reactive *values* — we can also run arbitrary *statements* reactively. For example, we can log the value of `count` whenever it changes: We're not limited to declaring reactive *values* — we can also run arbitrary *statements* reactively. For example, we can log the value of `count` whenever it changes:
```js ```js
$: console.log(`the count is ${count}`); $: console.log('the count is ' + count);
``` ```
> This example uses [a template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals "MDN Web Docs").
You can easily group statements together with a block: You can easily group statements together with a block:
```js ```js
$: { $: {
console.log(`the count is ${count}`); console.log('the count is ' + count);
alert(`I SAID THE COUNT IS ${count}`); alert('I SAID THE COUNT IS ' + count);
} }
``` ```

Loading…
Cancel
Save