Week 2 Review Flashcards

1
Q

if statement

A

if(boolean expression){

};

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

Difference between == and ===

A

=== has no type conversion

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

if-else statement

A

if(boolean experession){
} else {
}

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

The “and” operator

A

&&

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

The “or” operator

A

||

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

the “not” operator

A

!

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

switch statement

A
switch(variable) {
   case var_val_1:
  break;
  case var_val_2:
  break;
  default:
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

while statement

A

while (boolean) {

}

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

for statement

A
for (let i =1; i<5, i++){
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

declare a variable a with string value

A

a = “ a sentence”; or a = ‘a sentence’;

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

Operator to concatenate a string

A

+

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

concatinate a string with +=

A

String1 = ‘one’

String1 += ‘two’

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

find length of string

A

myString = “William”

myString.length

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

get second character of a string

A

myString = ‘William”

myString[1]

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

Create an array in JS

A

myArray[]

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

include a value in a string

A

my name is ${varble_with_name}

not these are backticks and not single quotes

17
Q

code to send a message to the browser window

A

alert(‘that is a no no!’ )

18
Q

code to ask a question of the user in browser window

A

prompt(‘What is your mother’s name’ )

19
Q

keyword to declare a variable that does not change

A

const

20
Q

let and const are ________ scoped variables

A

block

21
Q

a piece of code that produces a value

A

expression

22
Q

add X to end of an array called array1

A

array.push(X)

23
Q

delete the last element of an array called array1

A

array.pop()

24
Q

remove the first element of an array called array1

A

array1.shift()

25
Q

add to the beginning of an array

A

array1.unshift(x)