Computer Science, asked by gowthamsharma1221, 3 months ago

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 ravilaccs
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 anjaliom1122
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