4.2 js datatypes Flashcards
1
Q
Are strings mutable in JavaScript?
A
“No
2
Q
How do you check if the values of two strings are the same in JavaScript?
A
“Use ==”
3
Q
If var a = ‘123’; var b = ‘123’; what will document.write(a==b) print?
A
“true”
4
Q
What are some string methods in Javascript?
A
“charAt
5
Q
Which values are considered false in JavaScript?
A
“0
6
Q
What will Boolean(‘false’) return in Javascript?
A
“true”
7
Q
How do you output to the screen in Javascript?
A
“alert(‘The sum is:’+sum+’\n’);”
8
Q
What values can == do that === cannot?
A
“type coercion”
9
Q
If 3 !== ‘3’, what will be printed?
A
“yes”
10
Q
How do && and || work in Javascript?
A
“They do not necessarily return false or true”
11
Q
What does !! do?
A
“as Boolean(value)