typo
This commit is contained in:
parent
7da4376fda
commit
d2691263ce
1 changed files with 1 additions and 1 deletions
|
@ -421,7 +421,7 @@ alert( [1] + 1 ); // "11"
|
|||
alert( [1,2] + 1 ); // "1,21"
|
||||
```
|
||||
|
||||
Arrays do not have `Symbol.toPrimitive`, neither a viable `valueOf`, they implement only `toString` conversion, so here `[]` becomes an empty string, `[1]` becomes `"1"` and `[1,2]` becomes `"1,2".
|
||||
Arrays do not have `Symbol.toPrimitive`, neither a viable `valueOf`, they implement only `toString` conversion, so here `[]` becomes an empty string, `[1]` becomes `"1"` and `[1,2]` becomes `"1,2"`.
|
||||
|
||||
When the binary plus `"+"` operator adds something to a string, it converts it to a string as well, so the next step looks like this:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue