- A 3True
- B True
- C False
- D Error
- Share this MCQ
Answer:
B
Share this MCQ
This script defines a function called myFunction()
that does the following:
Declares a variable res and initializes it to an empty string.
Concatenates the result of the Number.isFinite()
function applied to the expression 5-2 to res
.
The Number.isFinite()
function returns a boolean value indicating whether the value passed to it is a finite number.
In this case, it would return true.
Selects the element with the ID "demo" and changes its inner HTML to the value of res.
When the function is called, the element with the ID "demo" would display the text "true".
Share this MCQ