search

Home  >  Q&A  >  body text

js三元运算符,还不是很明白,能举一个简单例子么?

checkcheck2903 days ago1069

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:32:39

    js ternary operator, I still don’t understand it very well, can you give a simple example? -PHP Chinese website Q&A-js ternary operator, I still don’t understand it very well. Can you give a simple example? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-22 13:09:10

    var x=1;
    var y=2;
    var z=x>y?x:y;

    判断x>y,成立就取x,不成立就取y

    reply
    1
  • Cancelreply