Skip to content

Commit

Permalink
Fix typo (mdn#36285)
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection authored Oct 9, 2024
1 parent 5266f2d commit 88da904
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ JSON.stringify({ value: 12345678901234567890 });

The value is not exactly equivalent to the original number any more! This is because JavaScript uses floating point representation for all numbers, so it cannot represent all integers exactly. The number literal `12345678901234567890` itself is already rounded to the nearest representable number when it is parsed by JavaScript.

Without `JSON.rawJSON`, there is no way to tell `JSON.stringify` to produce the number literal `12345678901234567000`, because there is simply no corresponding JavaScript number value. With raw JSON, you can directly tell `JSON.stringify()` what a particular value should be stringified as:
Without `JSON.rawJSON`, there is no way to tell `JSON.stringify` to produce the number literal `12345678901234567890`, because there is simply no corresponding JavaScript number value. With raw JSON, you can directly tell `JSON.stringify()` what a particular value should be stringified as:

```js
const rawJSON = JSON.rawJSON("12345678901234567890");
Expand Down

0 comments on commit 88da904

Please sign in to comment.