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

functionheight()  

{     

var  height=123.56;  

var type =(height>=190)?"Taller":"Little short";  

return type;  

}  

a) 123.56

b) Taller

c) 190

d) Little shorter

1 Answer

0 votes
by

Answer: B

Reason: In the above given code, the ternary operator is used that works on the 3 operands. The statement in the following code, initialize the type variable with value "little shorter" that is returned through the function.

Related questions

0 votes
asked Mar 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 21, 2021 in JavaScript by rajeshsharma
...