UI
ALL
What is the output after executing this script?
var car = {type:"Maruthi", model:"zen", color:"white");
alert(car.price);
5
5
Pick ONE option
6
O NaN
7
undefined
8
O
null
9
0
10
Clear Selection​
Answers
Answered by
1
Answer:
The Correct answer is option 7 undefined
Explanation:
var car = {type:"Maruthi", model:"zen", color:"white");
alert(car.price);
In the above program, the price has not defined as any value to it
Answered by
1
Answer:
Correct option is 7 undefined
Explanation:
var car={type:"maruthi",model:"zen",color:"white"};
alert(car.price);
Undefined is the sort of variable that hasn't been assigned a value. If the variable being evaluated does not have an assigned value, the method or expression returns undefined. If no value is returned, a function returns undefined.
variable is undefined:
So the correct way to test undefined variable or property is using the typeof operator, like this: if(typeof myVar === 'undefined') .
Similar questions
English,
1 month ago
Social Sciences,
1 month ago
Science,
3 months ago
Hindi,
10 months ago
History,
10 months ago