fix missed line breaks

This commit is contained in:
Lavrentiy Rubtsov 2022-03-23 00:00:51 +06:00 committed by GitHub
parent 6e515742e5
commit 39aca70984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,6 +53,7 @@ alert(id); // TypeError: Cannot convert a Symbol value to a string
That's a "language guard" against messing up, because strings and symbols are fundamentally different and should not accidentally convert one into another.
If we really want to show a symbol, we need to explicitly call `.toString()` on it, like here:
```js run
let id = Symbol("id");
*!*
@ -61,6 +62,7 @@ alert(id.toString()); // Symbol(id), now it works
```
Or get `symbol.description` property to show the description only:
```js run
let id = Symbol("id");
*!*