4.2 js datatypes Flashcards

1
Q

Are strings mutable in JavaScript?

A

“No

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

How do you check if the values of two strings are the same in JavaScript?

A

“Use ==”

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

If var a = ‘123’; var b = ‘123’; what will document.write(a==b) print?

A

“true”

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

What are some string methods in Javascript?

A

“charAt

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

Which values are considered false in JavaScript?

A

“0

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

What will Boolean(‘false’) return in Javascript?

A

“true”

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

How do you output to the screen in Javascript?

A

“alert(‘The sum is:’+sum+’\n’);”

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

What values can == do that === cannot?

A

“type coercion”

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

If 3 !== ‘3’, what will be printed?

A

“yes”

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

How do && and || work in Javascript?

A

“They do not necessarily return false or true”

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

What does !! do?

A

“as Boolean(value)

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