0 votes
in JavaScript by
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 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 21, 2021 in JavaScript by rajeshsharma
...