javascript - JSLint complains over math operator "++" syntax -


why jslint complainig syntax:

var myint; myint = 0;  myint++; 

www.jslint.com response:

unexpected '++'. myint++;

jslint doesn't ++, wants use myint += 1. highly debatable, see why avoid increment ("++") , decrement ("--") operators in javascript?

there option let pass, though (on web interface, it's under "tolerate...").

from jslint help:

the ++ (increment) , -- (decrement) operators have been known contribute bad code encouraging excessive trickiness. second faulty architecture in enabling viruses , other security menaces. also, preincrement/postincrement confusion can produce off-by-one errors extremely difficult diagnose. there plusplus option allows use of these operators.


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c++ - CryptStringToBinary API behavior -