Skip to content

Commit 27dd75f

Browse files
committed
update docusaurus
1 parent 3af1924 commit 27dd75f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

website/src/pages/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,14 +635,14 @@ Consider the advantages of explicitly defining the return type of a function::
635635
636636
### Const Assertion
637637
638-
Strive to use const assertion `as const`:
638+
Strive declaring constants using const assertion `as const`:
639639
640640
- type is narrowed
641641
- object gets `readonly` properties
642642
- array becomes `readonly` tuple
643643
644644
```ts
645-
// ❌ Avoid declaring constants without const assertion
645+
// ❌ Avoid
646646
const FOO_LOCATION = { x: 50, y: 130 }; // Type { x: number; y: number; }
647647
FOO_LOCATION.x = 10;
648648

@@ -652,7 +652,7 @@ Strive to use const assertion `as const`:
652652
const RATE_LIMIT = 25;
653653
const RATE_LIMIT_MESSAGE = `Max number of requests/min is ${RATE_LIMIT}.`; // Type string
654654

655-
// ✅ Use const assertion
655+
// ✅ Use
656656
const FOO_LOCATION = { x: 50, y: 130 } as const; // Type '{ readonly x: 50; readonly y: 130; }'
657657
FOO_LOCATION.x = 10; // Error
658658

0 commit comments

Comments
 (0)