5 big security mistakes coders make | Security – InfoWorld

5 big security mistakes coders make | Security – InfoWorld – http://m.infoworld.com/t/security/5-big-security-mistakes-coders-make-246529?source=IFWNLE_nlt_stradev_2014-07-22&utm_medium=referral&utm_source=pulsenews

Javascript Comma Operator

I had quite frankly never heard of this operator before and ran into it while debugging an app. Basically I had an if statement as such:


which would to my surprise evaluate to true and not give me a syntax error which I was expecting given the “misplaced” comma.
A little bit of feedback from my colleagues and Google-Fu and I was enlightened: The Javascript Comma Operator:
“You can use the comma operator when you want to include multiple expressions in a location that requires a single expression. The most common usage of this operator is to supply multiple parameters in a for loop.”
You learn a little bit everyday.

%d bloggers like this: