Skip to content

Commit acf8153

Browse files
Update apps/site/pages/en/learn/typescript/introduction.md
Co-authored-by: Brian Muenzenmeyer <[email protected]> Signed-off-by: Augustin Mauroy <[email protected]>
1 parent 5b831b7 commit acf8153

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/site/pages/en/learn/typescript/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const isJustineAnAdult = isAdult(justine);
4242

4343
The first part (with the `type` keyword) is responsible for declaring our custom object type representing users. Later we utilize this newly created type to create function `isAdult` that accepts one argument of type `User` and returns `boolean`. After this, we create `justine`, our example data that can be used for calling the previously defined function. Finally, we create a new variable with information on whether `justine` is an adult.
4444

45-
There are additional things about this example that you should know. Firstly, if we would not comply with declared types, TypeScript would alarm us that something is wrong and prevent misuse. Secondly, not everything must be typed explicitly - TypeScript is very smart and can infer types for us. For example, variable `isJustineAnAdult` is of type `boolean` even if we didn't type it explicitly or `justine` would be valid argument for our function even though we didn't declare this variable as of `User` type.
45+
There are additional things about this example that you should know. Firstly, if we would not comply with declared types, TypeScript would inform us that something is wrong and prevent misuse. Secondly, not everything must be typed explicitly - TypeScript is very smart and can infer types for us. For example, variable `isJustineAnAdult` is of type `boolean` even if we didn't type it explicitly or `justine` would be valid argument for our function even though we didn't declare this variable as of `User` type.
4646

4747
## How to run TypeScript code
4848

0 commit comments

Comments
 (0)