TypeScript Flashcards

1
Q

enum

A

enum Response {
No = 0,
Yes = 1,
}

function respond(recipient: string, message: Response): void {
    // ...
}

respond(“Princess Caroline”, Response.Yes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

TypeScript - Variables

A

https://www.tutorialspoint.com/typescript/
typescript_variables.htm#:~:text=TypeScript%
20Variable%20Scope&text=Fields%20or%20
class%20variables%20are,accessed%20
using%20the%20class%20name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

readonly variables

Prefix readonly is used to make a property as read-only. Read-only members can be accessed outside the class, but their value cannot be changed. Since read-only members cannot be changed outside the class, they either need to be initialized at declaration or initialized inside the class constructor.

A

https://www.tutorialsteacher.com/typescript/typescript-readonly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

8 Best Practices for Future-Proofing Your TypeScript Code

A

https://medium.com/better-programming/8-best-practices-for-future-proofing-your-typescript-code-2600fb7d8063

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

using absolute path in angular

tsconfig.base.json file

A

https://stackoverflow.com/
questions/41460810/avoiding-relative-paths-in-angular-cli

https: //medium.com/@adrianfaciu/use-absolute-paths-for-module-imports-6e5ee9e94161
https: //stackoverflow.com/questions/55916731/using-absolute-paths-in-typescript-for-imports
https: //netbasal.com/sexier-imports-in-typescript-e3c645bdd3c6
https: //devblogs.microsoft.com/typescript/announcing-typescript-3-9/#solution-style-tsconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

8 Best Practices for Future-Proofing Your TypeScript Code

A

https://medium.com/better-programming/8-best-practices-for-future-proofing-your-typescript-code-2600fb7d8063

How well did you know this?
1
Not at all
2
3
4
5
Perfectly