Quantcast
Viewing all articles
Browse latest Browse all 130

Use Idioms To Make Your Intentions More Concise (Blog Entry)

To "===" or not to "=="

About 6 months ago, I came across an online tool called JSLint. It's a JavaScript program that looks for problems in JavaScript code. I began using it to check most of my scripts to see if I had any errors in them (I know, I know... you thought I was perfect). Well as it turns out, I had a lot of little mistakes, like using a function or object before it was defined or little formating issues. But one error I kept receiving made no sense to me and I honestly didn't understand why I was getting it.

Expected '===' and instead saw '=='.Expected '!==' and instead saw '!='.

Granted, it wasn't like I didn't understand how to fix the issue, but JSLint wasn't very forthcoming on why I needed to make these changes. So, without fully understanding what wasgoing on, I began using "===" and "!==" whenever I needed to make a logical comparision. And I've been doing this for the past 6 months, without a clue as to "why".


Viewing all articles
Browse latest Browse all 130

Trending Articles