Algorithm for javascript pre-defined functions (parseInt, parseFloat, isNaN, etc.)

后端 未结 3 1001
心在旅途
心在旅途 2021-01-11 23:56

What is the best way, if even possible, to see the underlying code for the predefined functions in Javascript. Is there documentation that shows how these were coded, or an

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 00:15

    They are native functions, and maybe coded in the language your JS engine was written in - you'd need to contact it's source.

    However, you probably are more interested in the EcmaScript specification that describes how the algorithms work.

    And if you're lucky, for some of the functions you even might find an JS equivalent. You'll find them mostly on pages that test ES implementations against the standard.

提交回复
热议问题