The question mark in JavaScript is commonly used as conditional operator — called ternary operator when used with a colon (:) and a question mark (?) — to assign a variable name conditionally .
The question mark in JavaScript is commonly used as conditional operator — called ternary operator when used with a colon (:) and a question mark (?) — to assign a variable name conditionally .