Update docs/index-type-operator.md

Following, Aaron's comment, reworded last sentence of  motivation to target broader audience

Co-authored-by: aaron <aweiss@hey.com>
This commit is contained in:
Junseo Yoo 2024-05-30 13:13:24 -07:00 committed by GitHub
parent 7893ca4d9a
commit a17cfd48d6
Signed by: DevComp
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,7 @@ type unionType = typeof(bob["age"]) | typeof(bob["name"]) | typeof(bob["alive"])
This is a valid Luau program; however, in order to define the type of `Person["age"]` we had to first declare a variable `bob` and utilize the `typeof` type operator. This is quite cumbersome when developers want to typecheck using the type of `Person["age"]` without having to declare a variable first. Additionally, in order to define the union type of all the properties of `Person`, current Luau requires an explicit list of each property using `typeof`.
The expected outcome of the index type operator is that it will enhance the developing experience and allow the Roblox community to develop better type-checked programs.
The expected outcome of the index type operator is that it will enhance developer experience and allow Luau developers to more easily develop well-typed programs.
## Design