Clase 2 Flashcards

1
Q

If JS

A

if(true){
console.log(‘Verdad’)
}

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

if…else

A

if(false){
console.log(‘Verdad’)
}else{
console.log(‘Falso’)
}

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

if…else if…else

A

if(valor == 1){
console.log(‘Es 1’)
} else if(valor < 10){
console.log(‘Es menor 10’)
} else if(valor >= 20 ){
console.log(‘Es mayor a 20’)
alert(‘Es mayor a 20’)
} else{
console.log(Es otro ${valor})
}

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

Verdad o segundo valor JS

A

true && console.log(‘verdad’)

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

Ternario

A

console.log(false ? ‘Verdadero’ : ‘falso’)

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