12. Revature Panel (TYPE SCRIPT)

12. Revature Panel (TYPE SCRIPT)

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

What are the datatypes in typescript?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

2

All-time users

2

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (10)

Section 1

(10 cards)

What are the datatypes in typescript?

Front

- string - number - boolean - array - any - void - null

Back

What does putting a question mark after a parameter name do?

Front

-Makes the parameter optional. - When you do this all other parameters to the right of this optional parameter must also be optional.

Back

What does using the "get" and "set" keywords in front of a function do?

Front

It allows the method to be used like a variable (without using parentheses)

Back

What happens when you put an access modifier on a constructor parameter in typescript?

Front

-automatically creates a member variable identical to the parameter's name - sets the member variable's value to the value of the constructor parameter.

Back

"any" acts like in js

Front

- var - let

Back

Does typescript have inheritance?

Front

- Yes, - you can inherit interfaces using "implements". - You can inherit another class by using "extends" but only a single class.

Back

What is a module?

Front

- Small units of independent, reusable code. - When you use the keyword "export" on a class it becomes a module for another file to import later.

Back

Does typescript have access modifiers?

Front

- Public - protected - private

Back

What is Typescript?

Front

- an open-source programming language developed and maintained by Microsoft. - It is a strict syntactical superset of JS - adds optional static typing to JS - Anything you can do in JS you can also do in typescript. - transpiled into JS before it is used by the browsers. - The syntax is closer to higher level languages like java. - It's strong typed and gives compiler errors while in the ide, making it easier to debug.

Back

What is linting?

Front

- Linting is the process of checking the source code for programmatic and stylistic errors. - It is useful in keeping code consistent as well as pointing out common mistakes that could potentially be problematic.

Back