Skip to content

Commit 4879734

Browse files
authored
Merge pull request #1004 from maurodibert/patch-47
Update article.md
2 parents 3a24b0a + d421e02 commit 4879734

File tree

1 file changed

+1
-1
lines changed
  • 1-js/04-object-basics/05-object-toprimitive

1 file changed

+1
-1
lines changed

1-js/04-object-basics/05-object-toprimitive/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ There is no control whether `toString()` returns exactly a string, or whether `S
164164
The only mandatory thing: these methods must return a primitive, not an object.
165165

166166
```smart header="Historical notes"
167-
For historical reasons, if `toString` or `valueOf` return an object, there's no error, but such value is ignored (like if the method didn't exist). That's because in ancient times there was no good "error" concept in JavaScript.
167+
For historical reasons, if `toString` or `valueOf` returns an object, there's no error, but such value is ignored (like if the method didn't exist). That's because in ancient times there was no good "error" concept in JavaScript.
168168
169169
In contrast, `Symbol.toPrimitive` *must* return a primitive, otherwise there will be an error.
170170
```

0 commit comments

Comments
 (0)