JavaScript Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Types of directives

A

Manipulate DOM.
Components - directives with template.
Structural - ngFor, nfIg
Attribute - change appearance behaviour

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

Services in Angular

A

Reusable pieces of code, organises logic that can be used anywhere in the code.

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

Data binding in Angular

A

Communication between component and template. Component to template - attribute, interpolation, style, class []. Template to component - event. Two way [()].

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

What are extra features of TS, JS doesn’t have.

A

Has ES6 plus more. Interfaces, enums, generics, access modifiers, modules, optional params. It’s own CLI, error checking, types, compiler.

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

Why is JS great?

A

Richer interfaces, quicker feedback loop - doesn’t have to go to server, user gets what they want. Runs in browser.

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

What is call back?

A

Function that is invoked once a specified action finishes.

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

What is closure?

A

JS concept in which inner function has access to variables of parent function + global.

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

What is ECMA?

A

Set of standards, guidelines for JS. New ES6.

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

What is hoisting?

A

Feature of JS when JS engine starts to interpret the code, it moves all the definitions to the top of the script.

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

Why arrow fn?

A

Scope safe, don’t have this, don’t have constructor, are not hoisted, no name.

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

What is scope?

A

Defines availability, accessibility of variables in parts of code.

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

What are prototypes?

A

Type of inheritance but it’s a working sample, not predefined. Standard that has to be followed objects prototype can be composed of various properties.

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

spread vs rest

A

Spread - makes copies, can represent array values.

Rest - params.

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

Observable vs Promise

A

Way to handle async processes. Observable - returns multiple values overtime, lazy loaded - nothing until we can subscribe, provides error handling. Promises - return only one value, as soon as created it starts to execute.

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