js里这种表述式是啥意思?return (y1 - y2 > 0 ? "Up" : "Down");
巴扎黑
巴扎黑 2017-01-23 11:18:39
0
1
1095

js里这种表述式是啥意思?return (y1 - y2 > 0 ? "Up" : "Down");这个在js里叫啥表达式?

巴扎黑
巴扎黑

reply all(1)
面对疾风吧

三目运算,跟Java差不多;你也可以换成 
if(y1-y2>0){ 
    return "up"; 
}else{ 
    return "down"; 
}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!