Diagram showing an overview of Javascript type conversion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • java

    #1

    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).



    It's not comprehensive but covers most common scenarios.

    Best regards,
    --j
  • Erwin Moller

    #2
    Re: Diagram showing an overview of Javascript type conversion

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

    >
    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.

    Comment

    • Richard Cornford

      #3
      Re: Diagram showing an overview of Javascript type conversion

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

      >
      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.


      Comment

      Working...