[docs] simplify template literals to string primitives (#6806)

pull/6994/head
Dominik Leicht 3 years ago committed by GitHub
parent 791e40d070
commit 67f79dd934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -5,15 +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:
```js
$: console.log(`the count is ${count}`);
$: console.log('the count is ' + count);
```
You can easily group statements together with a block:
```js
$: {
console.log(`the count is ${count}`);
alert(`I SAID THE COUNT IS ${count}`);
console.log('the count is ' + count);
alert('I SAID THE COUNT IS ' + count);
}
```
@ -21,7 +21,7 @@ You can even put the `$:` in front of things like `if` blocks:
```js
$: if (count >= 10) {
alert(`count is dangerously high!`);
alert('count is dangerously high!');
count = 9;
}
```
Loading…
Cancel
Save