考虑以下两段代码:
var adj=0>grip.y?0<grip.x?0:-180:0<grip.x?-360:-180;
和
var adj;
if (grip.y < 0) {
if (grip.x > 0)
adj = 0;
else
adj = -180;
}
else {
if (grip.x > 0)
adj = -360;
else
adj = -180;
}
它们都产生相同的结果,但哪个更快?