Showing posts with label operators. Show all posts
Showing posts with label operators. Show all posts

Sunday, May 27, 2012

JavaScript === vs == : Does it matter which "equal' operator I use?


I'm using JSLint to go through some horrific JavaScript at work and it's returning a huge number of suggestions to replace == with === when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.

Why does this go into an infinite loop?


I'm a teacher, and yesterday a student wrote the following code:

Wednesday, May 23, 2012

Java += operator


Until today I thought that for example:




i += j;



is just a shortcut for:

Tuesday, May 8, 2012

Make the plus sign a string in java


So I want the plus sign to be stored as a string and displayed to the screen later; so in this case I have

Sunday, April 8, 2012

Friday, April 6, 2012

"AND" vs "&&" as operator


Actually, I am facing a codebase where developpers decided to use ' AND ' and ' OR ' instead of ' && ' and ' || '. I know that there is difference in operators precedence ( && goes before ' and '), but with given framework (prestashop to be precise) is clearly not a reason. So, my question: which version are you using? Is ' and ' more readable than ' && '? || there is ~ difference?