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).

Related questions

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