Examveda

Among the following, which one is a ternary operator?

A. +

B. :

C.

D. ?:

Answer: Option D

Solution (By Examveda Team)

A ternary operator is a conditional operator that takes three operands.

In JavaScript, ?: is the ternary operator.

It is used for conditional expressions.

The syntax is condition ? expr1 : expr2.

Options +, :, and - are not ternary operators.

This Question Belongs to Javascript >> Basic And Variables

Join The Discussion

Related Questions on Basic and Variables