# 求解一个js的三元运算符。实在看不懂

0

b[3].call(g, j, j.val()) ? "error" == k ? (j.data("vali", 1), c.effects(j, "OK", "correct")) : "empty" == k && (j.data("vali", 1),"" == j.val() ? c.effects(j, "", "empty") : c.effects(j, "OK", "correct")) : (j.data("vali", 0), c.effects(j, e, k))

0

@小徐的博客:

`a=="a" ? b=="b" ? (alert(1),alert(2)) : c=="c" && (alert(3) ,d=="d" ? alert(4) : alert(5)) : (alert(6),alert(7))`

`if(a=="a"){    if(b=="b"){        alert(1);        alert(2);    }    else{        if(c=="c"){            alert(3);            if(d=="d")                alert(4);            else                alert(5);        }    }}else{    alert(6);    alert(7);}`

`if(b[3].call(g, j, j.val())){    if("error" == k){        j.data("vali", 1);        c.effects(j, "OK", "correct");    }    else{        if("empty" == k){            j.data("vali", 1);            if("" == j.val())                c.effects(j, "", "empty");            else                c.effects(j, "OK", "correct");        }    }}else{    j.data("vali", 0);    c.effects(j, e, k);}`

`0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111  67   67   67   67   67   67   67   67             35   34   12   12   12   12`

您需要登录以后才能回答，未注册用户请先注册