Javascript-Methods Flashcards

1
Q

Why do we log things to the console?

A

We log code to the console to double check that our outputs are what we expect them to be and to debug if problems occur.

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

What is a method?

A

A method is a function that is a property of an object

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

How is a method different from any other function?

A

It is called with the Object name.

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

How do you remove the last element from an array?

A

The pop method

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

How do you round a number down to the nearest integer?

A

Using the floor method of the Math object

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

How do you delete an element from an array?

A

Using the pop and shift method

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

How do you append an element to an array?

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