Consider the following code:

Which of the following is true based on the above code?
Suggested Answer: A
Get Premium 1D0-735 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
31 comments · newest first
AN
Angelica
1 year ago
D sounds right, but I’m not sure about the order of execution.
MA
Major
1 year ago
Wait, how can A be invalid? Seems fine to me!
LI
Lili
1 year ago
C is misleading, 0 won't show unless explicitly set.
CH
Cherelle
1 year ago
I think B is correct, 98.7 means 'no fever'.
CA
Carmela
1 year ago
A is definitely valid syntax.
GL
Gladis
1 year ago
I vaguely recall that the default value of variables can be undefined, so C seems off to me.
ST
Starr
1 year ago
I practiced a similar question where the order of function definitions mattered, so I think D could be right too.
ME
Mendy
1 year ago
I'm not sure about B, but I feel like if temp is exactly 98.7, it should say 'no fever' based on the condition.
XU
Xuan
1 year ago
I think option A might be correct because I remember something about syntax rules in JavaScript.
TU
Tuyet
1 year ago
I think it's about how users are influenced by others' actions in the space. Is that social navigation?
RE
Reta
1 year ago
I'm a bit confused on this one. I know Discovery has some specialized methods, so I'm not sure if it's as straightforward as Ping. Port Scan or Traceroute could also be possibilities. I'll have to think this through carefully.
CR
Crista
1 year ago
Hmm, I'm not sure about this one. I'm trying to think through the different options, but I'm a bit confused on what would most likely trigger premature closure.
TA
Tamar
2 years ago
The code looks like it was written by a programmer with a fever. Maybe they should have checked their own temperature first.
TA
Tamie
1 year ago
C) The default value of 0 will be displayed when the page loads
LE
Leonor
2 years ago
B) Entering 98.7 results in the statement. \'You have no fever \'
SE
Sean
2 years ago
A) fever = (temp > 98.7) ? \'a fever\': \'no fever\'; is not a valid statement
KI
Kimbery
2 years ago
The checktemp function will run because it is called before it is defined. In JavaScript, function declarations are hoisted to the top of the scope, so the function will be available when it is called.
AU
Audry
2 years ago
The default value of 0 will not be displayed because the ternary operator will always assign a value, either 'a fever' or 'no fever'.
IS
Isaac
2 years ago
C) The default value of 0 will be displayed when the page loads
CA
Catarina
2 years ago
B) Entering 98.7 results in the statement. \'You have no fever \'
DE
Desirae
2 years ago
A) fever = (temp > 98.7) ? \'a fever\': \'no fever\'; is not a valid statement
MI
Mirta
2 years ago
C) The default value of 0 will be displayed when the page loads
HI
Hillary
2 years ago
B) Entering 98.7 results in the statement. \'You have no fever \'
CA
Carole
2 years ago
A) fever = (temp > 98.7) ? \'a fever\': \'no fever\'; is not a valid statement
JU
Junita
2 years ago
Entering 98.7 will result in the statement 'You have a fever', not 'You have no fever'. The condition temp > 98.7 is true for 98.7, so the first part of the ternary operator will be executed.
JO
Joanne
2 years ago
User 2: B) Entering 98.7 results in the statement 'You have no fever'
LE
Lelia
2 years ago
User 1: A) fever = (temp > 98.7) ? 'a fever': 'no fever'; is not a valid statement
SH
Sharika
2 years ago
The code is valid and will work as expected. The ternary operator is a concise way to assign a value based on a condition.
TH
Thora
2 years ago
But if you look at the code, it clearly shows that entering 98.7 will result in 'You have no fever.'
KI
Kiera
2 years ago
I disagree, I believe the correct answer is A) fever = (temp > 98.7) ? 'a fever' : 'no fever'; is not a valid statement.
TH
Thora
2 years ago
I think the correct answer is B) Entering 98.7 results in the statement. 'You have no fever.'