js三元运算符

<html lang="en"> <head> <meta charset="UTF-8"> <title>三元运算符</title>
<script>
    var a = 3;
    var b = 4;

    var c = a > b ? 1:0;

    alert(c);


</script>
posted @ 2020-07-10 23:18  神树一世  阅读(132)  评论(0编辑  收藏  举报