devXero's blog

a blog about agile, development, and automation

Triple equals in Javascript

Posted by Mike Longin on August 25, 2009

I know most of my posts are about agile, scrum, and automation, but I do come across some coding tips now and then and I wanted to pass them on.  In one of the sessions today, James Suchy demonstatrated doing TDD in javascript.  While going through this he demonstrated the triple equals comparison which I had seen once before but never looked at.

The tiple equals does a true comparison.  In Javascript == can be used to compare 0 and false.  Such that (0 == false) would return true.  However (0 === false) would return false.

I found this link that helped explain it a little better.

http://longgoldenears.blogspot.com/2007/09/triple-equals-in-javascript.html

Advertisements

2 Responses to “Triple equals in Javascript”

  1. Gud information thanks 😉
    More notes about javascript on
    http://javascriptfactory.blogspot.com/

  2. http://javascriptfactory.blogspot.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: