JS Flashcards

1
Q

Give 6 examples of comparison operators.

A

!= , ====, == !==, < ,>

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

What data type do comparison expressions evaluate to?

A

Boolean

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

What is the purpose of an if statement?

A

Execute a condition if a statement exists

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

Is else required in order to use an if statement?

A

no

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

Describe the syntax (structure) of an if statement.

A

if () {}

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

What are the three logical operators?

A

&&, I I,!

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

How do you compare two different expressions in the same condition?

A

logical and non logical

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

Why do we log things to the console?

A

to check for errors to fix in the code

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

What is a method?

A

a method is a function which is a property of an object

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

How is a method different from any other function?

A

a method is a built it in task

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

How do you remove the last element from an array?

A

arra.pop()

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

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

A

Math.floor()

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

How do you generate a random number?

A

Math.Random

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

How do you delete an element from an array?

A

splice and pop

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

How do you append an element to an array?

A

.push

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

How do you break a string up into an array?

A

split

17
Q

Do string methods change the original string? How would you check if you weren’t sure?

A

nope, console.log