JS Flashcards

1
Q

What are arrays used for ?

A

Creating a list

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

Describe array literal notation.

A

[]

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

How are arrays different from “plain” objects?

A

Arrays have an order

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

What number represents the first index of an array?

A

0

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

What is the length property of an array?

A

counts how many interms are in array (array.lenght)

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

How do you calculate the last index of an array?

A

array.length-1

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

What is a function in JavaScript?

A

Functions packs a code for resuse through a program

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

Describe the parts of a function definition.

A

function keyword ,then name, then (parameter), then {code block}

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

Describe the parts of a function call.

A

writing a function name then ()

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

When comparing them side-by-side, what are the differences between a function call and a function definition?

A

function call is asking the function to run, while defining the function is constructing the function it’s self

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

What is the difference between a parameter and an argument?

A

The parameter is used to pass an argument

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

What two effects does a return statement have on the behavior of a function?

A

causes the function to produce a value and exits the function

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