DEV Community

rajeshwari rajeshwari
rajeshwari rajeshwari

Posted on

Ternary Opater,

****what is ternary operater?
the ternary operater is a shorthand for if-else statements.it's used in react in jsx to conditionally render components or elements

example:

funtion Greeting({ isLoggedIn}) {

return (



{isLoggedIn}

{welcome back!}

:

please sing in.

}



);

}

syntax:

condition ? expressionIfTrue: expressionIfFalse.

Top comments (0)