471,887 Members | 1,292 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

Diagram showing an overview of Javascript type conversion

Hi:

There is an introductory diagram for those confused by
javascript type wrangling (i.e., runtime type conversion
by the javascript interpreter).

http://mollypages.org/misc/jstypes.mp

It's not comprehensive but covers most common scenarios.

Best regards,
--j
Mar 25 '08 #1
2 2219
java schreef:
Hi:

There is an introductory diagram for those confused by
javascript type wrangling (i.e., runtime type conversion
by the javascript interpreter).

http://mollypages.org/misc/jstypes.mp

It's not comprehensive but covers most common scenarios.

Best regards,
--j
type Status report

message /misc/jstypes.mp

description The requested resource (/misc/jstypes.mp) is not available.
Mar 26 '08 #2
java wrote:
There is an introductory diagram for those confused by
javascript type wrangling (i.e., runtime type conversion
by the javascript interpreter).

http://mollypages.org/misc/jstypes.mp

It's not comprehensive but covers most common scenarios.
On that diagram the statement "null and undefined convert to NaN so they
always return false when compared to a different type" is not true. The
algorithms for type-converting comparison do not type-convert null and
undefined values at all, and no type-conversation would result in null
becoming NaN (it become zero if type-converted into numbers (and so
would be equal to zero if type-conversion was part of the comparison
process)).

The "Comparison is intuitive" comment when both sides of comparisons are
the same type does not take account of the fact that - NaN == NaN - is
false (and - NaN != NaN - true).

Richard.
Mar 26 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Ara.T.Howard | last post: by
136 posts views Thread by Matt Kruse | last post: by
1 post views Thread by Maria | last post: by
3 posts views Thread by Lee Crabtree | last post: by
2 posts views Thread by José Joye | last post: by
5 posts views Thread by Flak | last post: by
9 posts views Thread by crater | last post: by
1 post views Thread by Jennifer Jazz | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.