Learn about how and when to use ternary operator in Javascript Ternary operator in Javascript Ternary operator is also denoted as conditional operator. Ternary operator is the compact version of if statement. If youβre going to check for simple condition, then ternary operator is highly recommended instead of if block. Example of using normal if …