Dear candidates you will find MCQ questions of JavaScript here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
var a = Math.max(); var b = Math.min(); print(a); print(b);
Let's go through this carefully.
You have this JavaScript code:
var a = Math.max();
var b = Math.min();
print(a);
print(b);
Now:
Why?
Because:
Thus:
So, the output will be:
-Infinity
Infinity
Therefore, the correct answer is:
(A) -Infinity Infinity
var a = Math.max() < Math.min(); var b = Math.max() > Math.min(); print(a); print(b);
const obj1 = {first: 20, second: 30, first: 50};
console.log(obj1);
function dog() {
print("I am a dog.");
}
dog.sound = "Bark";
const obj1 = {Name: "Hello", Age: 16};
const obj2 = {Name: "Hello", Age: 16};
print(obj1 === obj2);
let n = 24;
let l = 0, r = 100, ans = n;
while(l <= r) {
let mid = Math.floor((l + r) / 2);
if(mid * mid <= n) {
ans = mid;
l = mid + 1;
}
else {
r = mid - 1;
}
}
print(ans);