known about this for awhile but since we are on the topic...  there
has to be some over head of using == and !=....  does anyone know for
sure the impact of the overhead...  and does it matter of the type....


On Aug 2, 6:21 am, "Ian Struble" <[EMAIL PROTECTED]> wrote:
> !== and === are identity operators.  It is a good idea to use them
> instead of the equality operators (!= and ==) unless you know why you
> would want to use equality (and the possible type coercion) over
> identity.  Probably the biggest gotcha with equality is with falsy
> values (false, 0, undefined, ""/empty string, null and NaN).   The
> truthy / falsy issue is probably what bit you Rob.
>
> It may be worth reading a bit of Douglas Crockford's ideas about
> javascript if you are trying to figure out identity and equality
> operators:
>
>    http://javascript.crockford.com/code.html
>
> And here is something about truthy and falsy:
>
>  http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript#...
>
> Ian
>
> On 8/2/07, Rob Desbois <[EMAIL PROTECTED]> wrote:
>
> > 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