Skip to content

Commit

Permalink
Merge pull request #42632 from Expensify/cristipaval-patch-1
Browse files Browse the repository at this point in the history
Fix typo in STYLE.md
  • Loading branch information
stitesExpensify authored May 27, 2024
2 parents c22945a + 42d8916 commit 406e7bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contributingGuides/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const foo: object = [1, 2, 3]; // TypeScript does not error

If you know that the type of data is an object but don't know what properties or values it has beforehand, use `Record<string, unknown>`.

> Even though `string` is specified as a key, `Record<string, unknown>` type can still accepts objects whose keys are numbers. This is because numbers are converted to strings when used as an object index. Note that you cannot use [symbols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) for `Record<string, unknown>`.
> Even though `string` is specified as a key, `Record<string, unknown>` type can still accept objects whose keys are numbers. This is because numbers are converted to strings when used as an object index. Note that you cannot use [symbols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) for `Record<string, unknown>`.
```ts
function logObject(object: Record<string, unknown>) {
Expand Down

0 comments on commit 406e7bf

Please sign in to comment.