in JavaScript by
Q:
Which one of the following is correct output for the following given JavaScript code:

var  obj=  

{  

    length:20,  

    height:35,  

}  

if('breadth' in obj === false)   

{  

    obj.breadth = 12;  

}  

   

console.log(obj.breadth);  

a) Error

b) Undefined

c) 12

d) 20

1 Answer

0 votes
by

Answer: C

Reason: In the above given JavaScript code, the "in" operator is used which checks (or performs search) for the specific property. If the certain property is found it returns true otherwise it returns false.

Related questions

0 votes
asked Mar 23 in JavaScript by sharadyadav1986
0 votes
asked Mar 21 in JavaScript by rajeshsharma
...