Docsity

Code HS Test 2: JavaScript Boolean Operators and Comparisons, Exams of Nursing

Toggle sidebar
bg1
Code HS Test 2
Which of the following is not a valid value for a Boolean?
true
false
yes
The above are all valid - correct answer yes
Question: 1
What symbol represents the and operator in JavaScript?
AND
and
&
&& - correct answer &&
What symbol represents the or operator in JavaScript?
OR
or
|
|| - correct answer ||
After the following code runs, what is the value of isWeekend?
var isSaturday = true; var isSunday = false; var isWeekend = isSaturday || isSunday;
true
false
"isWeekend"
"isSaturday || isSunday"
pf2

Partial preview of the text

Download Code HS Test 2: JavaScript Boolean Operators and Comparisons and more Exams Nursing in PDF only on Docsity!

Code HS Test 2

Which of the following is not a valid value for a Boolean? true false yes The above are all valid - correct answer yes Question: 1 What symbol represents the and operator in JavaScript? AND and & && - correct answer && What symbol represents the or operator in JavaScript? OR or | || - correct answer || After the following code runs, what is the value of isWeekend? var isSaturday = true; var isSunday = false; var isWeekend = isSaturday || isSunday; true false "isWeekend" "isSaturday || isSunday"

ANSWERED - correct answer true What is the proper way to compare if two values are equal in a boolean expression in JavaScript? = == EQUALS is - correct answer == What is the proper operator for "not equals" in JavaScript? =! != ~= NOT EQUALS - correct answer != The AP Exam uses the following relational (comparison) operators: =, ≠, >, <, ≥, and ≤.As well, AND, OR and NOT are used instead of &&, || and !=. A comparison using a relational operator evaluates to a Boolean value. For example, a = b evaluates to true if a and b are equal; otherwise, it evaluates to false. Determine whether the following expression would evaluate to true or false. 7 = 6 OR 8 ≥ 4 false true - correct answer true

  • correct answer