3 ms·
c = c < 4 ? c + 1 : 0; What is this line of code saying exactly.. ?
by formika 16y ago
c = c < 4 ? c + 1 : 0;
What is this line of code saying exactly.. ?
- ericras 16y agohttp://en.wikipedia.org/wiki/Ternary_operation http://en.wikipedia.org/wiki/Ternary_operation if (c < 4) { c = c + 1; } else { c = 0; }
- rudasn 16y agoYou could learn a couple of things just by looking the code of others. If you use jQuery you can see the source and find this kind of code in many places. Also: var x = a || b || (function(){ /* stuff here */ })() or var a = b = b || {}
- deleted 16y ago[deleted]