I had a discussion on the use of the === and !== operators recently on this
list, my opinion was, and still is, that unless you explicitly WANT to allow
type conversion, you should be using these. Only use == and != if you really
want type conversion.

It's bitten me once, although I can't for the life of me remember how, but
it involved lots of in-depth debugging and head-scratching to find the
problem. I'm more wary now and think that these operators are the way to go.

--rob

On 8/2/07, Sam Collett <[EMAIL PROTECTED]> wrote:
>
>
> I don't think many actually use !== (and when you would want to use
> it) and many sites that show usage of operators don't cover !== (but
> do have ===).
>
> 3 != '3'     false
> 3 !== '3'    true
> 3 == '3'     true
> 3 === '3'    false
>
>
> On Aug 1, 9:33 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> > > I...cannot figure how what the heck === is.
> >
> > I see that Jake answered your question, but just for next time...
> >
> > You may have tried a Google search for "javascript ===" and been
> > disappointed to find it returned no useful results (because Google seems
> to
> > ignore the === in the search).
> >
> > The key thing to know is that ===, like most special symbols in
> JavaScript
> > such as + and -, is an operator. Now you can do a more productive Google
> > search:
> >
> > http://www.google.com/search?q=javascript+operators
> >
> > This will help when you run into !== and wonder what the heck *that* one
> is.
> > :-)
> >
> > -Mike
>
>


-- 
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.

Reply via email to