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

functionoutputfun(object)  

{  

    var place=object ?object.place: "Italy";  

    return "clean:"+ place;  

}  

console.log(outputfun({place:India}));  

a) Error

b) clean:Italy

c) clean:India

d) undefined

1 Answer

0 votes
by

Answer: C

Reason: In the following given code, the "?" ternary operator is used for comparing the values and place is determined (or initialized) according to the true condition that whether it returns true (1) or false (0).

...