commit
a3273fb3f0
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ alert(+user); // hint: number -> 1000
|
||||||
alert(user + 500); // hint: default -> 1500
|
alert(user + 500); // hint: default -> 1500
|
||||||
```
|
```
|
||||||
|
|
||||||
As we can see from the code, `user` becomes a self-descriptive string or a money amount depending on the conversion. The single method `user[Symbol.toPrimitive]` handles all conversion cases.
|
As we can see from the code, `user` becomes a self-descriptive string or a money amount, depending on the conversion. The single method `user[Symbol.toPrimitive]` handles all conversion cases.
|
||||||
|
|
||||||
|
|
||||||
## toString/valueOf
|
## toString/valueOf
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue