Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whats the difference between === and == 1

Status
Not open for further replies.

xpblueScreenOfDeath

Programmer
Sep 1, 2004
87
I don't quite understand when I need === instead of ==. Can someone clearify this for me?
 
=== means that both sides must be equivalent and of the same time.

== means that both sides must be equivalent

so that "0" == 0 will be true
but "0" === 0 will be false

note also that
"a" == 0 will be true as the "a" will be converted into a number as it is being compared against a number.

the manual is very helpful on this:
 
In jpadie's last post the phrase:

[tt]and of the same time.[/tt]

probably should have read:

[tt]and of the same type.[/tt]






Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top