js a triplet of expressions frequently used

Syntax: condition? Expression 1: Expression 2. Brackets conditions can not happen in the

                    = IsTrue the let true ; 

                    the let A = (IsTrue === true ) 'I am a true ah': "I am a false ah"? ; 
                    console.log (A) // I'm a true ah 

                    the let b = '' ; 
                    (IsTrue === false ?) b = 'I am true ah': b = 'I is false ah' ; 
                    console.log (b) // I is false ah

 

Guess you like

Origin www.cnblogs.com/lwming/p/11518068.html