I have seen jQuery code's like this
return 13 == t.keyCode ? (t.preventDefault(), !1) : void 0
What that mean for ?
and :
?
Please give me reference, because I still newbie in jQuery. Thank's a lot
I have seen jQuery code's like this
return 13 == t.keyCode ? (t.preventDefault(), !1) : void 0
What that mean for ?
and :
?
Please give me reference, because I still newbie in jQuery. Thank's a lot
It is a shorthand for if else:
Translation:
if(13 == t.keyCode) { return (t.preventDefault(), !1); } else { return void 0; }
Its ternary operator. Shorthand for writting if/else
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Conditional_Operator