JavaScript General Knowledge Flashcards

1
Q

What is the piece of code written between curly braces { } of an if statement is called?

A

Code block

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

Can you create multiple word property names? How is this done?

A

Yes they must be created in quotes.

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

Describe the function of the colon ’:’ character in a ternary expression with multiple cases.

A

The ’:’ character works essentially as an ‘else if’ clause after the second case.

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

How are default parameters specified?

A

By assigning the parameters in the parentheses a value using =.

If given no value or undefined for name when called, the function will use ‘stranger’.

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

How are function expressions declared using arrow notation?

A

As function expressions are usually declared, minus the function keyword, and adding the fat arrow => between the parentheses and the code block.

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

How are multi-line comments fomatted?

A

By commenting between /* and */.

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

How are parameters specified in function declarations?

A

Within the parentheses, separated by commas.

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

How are single line comments formatted?

A

Using //

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

How are template literals formatted?

A

Using backticks `` instead of quotation marks

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

How are variables inserted into template literals?

A

Inside the curly braces of ${}.

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