Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CIW 1D0-735 Exam - Topic 9 Question 37 Discussion

Consider the following code:Which of the following is true based on the above code?
A) fever = (temp > 98.7) ? 'a fever': 'no fever'; is not a valid statement
B) Entering 98.7 results in the statement. 'You have no fever '
C) The default value of 0 will be displayed when the page loads
D) The checktemp function will not run because it was called upon before it was defined

CIW 1D0-735 Exam - Topic 9 Question 37 Discussion

Actual exam question for CIW's 1D0-735 exam
Question #: 37
Topic #: 9
[All 1D0-735 Questions]

Consider the following code:

Which of the following is true based on the above code?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Angelica
9 months ago
D sounds right, but I’m not sure about the order of execution.
upvoted 0 times
...
Major
9 months ago
Wait, how can A be invalid? Seems fine to me!
upvoted 0 times
...
Lili
9 months ago
C is misleading, 0 won't show unless explicitly set.
upvoted 0 times
...
Cherelle
9 months ago
I think B is correct, 98.7 means 'no fever'.
upvoted 0 times
...
Carmela
10 months ago
A is definitely valid syntax.
upvoted 0 times
...
Gladis
10 months ago
I vaguely recall that the default value of variables can be undefined, so C seems off to me.
upvoted 0 times
...
Starr
10 months ago
I practiced a similar question where the order of function definitions mattered, so I think D could be right too.
upvoted 0 times
...
Mendy
10 months 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.
upvoted 0 times
...
Xuan
10 months ago
I think option A might be correct because I remember something about syntax rules in JavaScript.
upvoted 0 times
...
Tuyet
10 months ago
I think it's about how users are influenced by others' actions in the space. Is that social navigation?
upvoted 0 times
...
Reta
10 months 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.
upvoted 0 times
...
Crista
10 months 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.
upvoted 0 times
...
Tamar
1 year ago
The code looks like it was written by a programmer with a fever. Maybe they should have checked their own temperature first.
upvoted 0 times
Tamie
1 year ago
C) The default value of 0 will be displayed when the page loads
upvoted 0 times
...
Leonor
1 year ago
B) Entering 98.7 results in the statement. \'You have no fever \'
upvoted 0 times
...
Sean
1 year ago
A) fever = (temp > 98.7) ? \'a fever\': \'no fever\'; is not a valid statement
upvoted 0 times
...
...
Kimbery
1 year 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.
upvoted 0 times
...
Audry
1 year 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'.
upvoted 0 times
Isaac
1 year ago
C) The default value of 0 will be displayed when the page loads
upvoted 0 times
...
Catarina
1 year ago
B) Entering 98.7 results in the statement. \'You have no fever \'
upvoted 0 times
...
Desirae
1 year ago
A) fever = (temp > 98.7) ? \'a fever\': \'no fever\'; is not a valid statement
upvoted 0 times
...
Mirta
1 year ago
C) The default value of 0 will be displayed when the page loads
upvoted 0 times
...
Hillary
1 year ago
B) Entering 98.7 results in the statement. \'You have no fever \'
upvoted 0 times
...
Carole
1 year ago
A) fever = (temp > 98.7) ? \'a fever\': \'no fever\'; is not a valid statement
upvoted 0 times
...
...
Junita
1 year 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.
upvoted 0 times
Joanne
1 year ago
User 2: B) Entering 98.7 results in the statement 'You have no fever'
upvoted 0 times
...
Lelia
1 year ago
User 1: A) fever = (temp > 98.7) ? 'a fever': 'no fever'; is not a valid statement
upvoted 0 times
...
...
Sharika
1 year 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.
upvoted 0 times
...
Thora
1 year ago
But if you look at the code, it clearly shows that entering 98.7 will result in 'You have no fever.'
upvoted 0 times
...
Kiera
1 year ago
I disagree, I believe the correct answer is A) fever = (temp > 98.7) ? 'a fever' : 'no fever'; is not a valid statement.
upvoted 0 times
...
Thora
1 year ago
I think the correct answer is B) Entering 98.7 results in the statement. 'You have no fever.'
upvoted 0 times
...

Save Cancel