9. Other Flashcards

1
Q

What does === do?

A

Compares value and type (called strict equal to)

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

What function checks if a value is a number or not?

A

isNaN()

(works whether “5” or 5)

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

How to do OR

A

||

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

How to do AND

A

&&

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

How to do NOT

A

!

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

3 parts of a loop

A
  1. Initialization
  2. Condition
  3. Update
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to add 1 to i

A

i++

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

var fruits = [“Banana”, “Apple”, “Cherry”]; : how to sort fruits?

A

fruits.sort();

(sorts in alphabetical order or by numbers)

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

var matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
];
console.log(matrix); :
What will print?

A

[Array(3), Array(3), Array(3)]

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

In what are these the comment structures?:

/* This … will be in comment /
/
This is
a multi-line …
comment */

A

CSS and JavaScript (JS)

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

In what is this comment structure?:

<!– This … will be in comment –>

A

HTML

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

In what is this comment structure?:

// this … will be in comment

A

JavaScript only

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