本文介绍了内置的对象层次结构在javascript中是什么样的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在寻找一个图表,其中显示内置类型的javascript,如功能字符串但在谷歌上我一直在寻找与浏览器相关的东西的图表,比如 Window



我只是在寻找纯粹的js对象图。我知道ECMA规范,但我正在寻找一个图表,因为我是一个视觉类型。

解决方案

没有多少对于JavaScript类型的深度来说,图表会相当平坦。它基本上是(最后的UML):




  • 原始字符串

  • 原始数字

  • primitive boolean

  • 未定义类型,它只有一个实例: undefined

  • Null类型,它只有一个实例: null

  • 符号(基本类型)(ES2015 +)

  • 代理(一种对象类型,但没有默认对象支持的对象类型原型)(ES2015 +)

  • 对象


    • 数字

    • 字符串

    • 布尔值

    • 功能

    • 日期

    • RegExp

    • 数组

    • 数学

    • 错误


      • EvalError

      • RangeError

      • ReferenceError

      • SyntaxError

      • TypeError

      • URIError


    • JSON (ES5 +)

    • ArrayBuffer (ES2015 +)

    • DataView (ES2015 +)

    • 键入的数组( Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array )(ES2015 +)

    • 地图(ES2015 +)

    • WeakMap (ES2015 +)

    • 设置(ES2015 +)

    • WeakSet (ES2015 +)

    • 承诺(ES2015 +)

    • 反映(ES2015 +)




所以在UML中,有点像



(点击打开图像以便你可以放大)





请注意,这只是 JavaScript ' s型树。它不包括许多在浏览器上经常使用 with JavaScript的其他内容(例如,,,等等。)


I was looking for a diagram which shows the built in types of javascript like Function and String but on google I keep finding diagrams with the browser-related stuff like Window.

I'm just looking for the pure js object diagram. I know about the ECMA specification but I'm looking for a diagram because I'm a visual type.

解决方案

There's not much depth to the JavaScript types to speak of, the diagram would be fairly flat. It's basically (UML at the end):

  • primitive string
  • primitive number
  • primitive boolean
  • the Undefined type, which has exactly one instance: undefined
  • the Null type, which has exactly one instance: null
  • Symbol (a primitive type) (ES2015+)
  • Proxy (an object type, but one not backed by the default object prototype) (ES2015+)
  • Object
    • Number
    • String
    • Boolean
    • Function
    • Date
    • RegExp
    • Array
    • Math
    • Error
      • EvalError
      • RangeError
      • ReferenceError
      • SyntaxError
      • TypeError
      • URIError
    • JSON (ES5+)
    • ArrayBuffer (ES2015+)
    • DataView (ES2015+)
    • The typed arrays (Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array) (ES2015+)
    • Map (ES2015+)
    • WeakMap (ES2015+)
    • Set (ES2015+)
    • WeakSet (ES2015+)
    • Promise (ES2015+)
    • Reflect (ES2015+)

So in UML, something like this:

(click the image to open it so you can zoom)

Note that this is just JavaScript's type tree. It doesn't include lots of other things that are often used with JavaScript on browsers (such as the DOM, the worker's API, web storage, the File API, etc., etc.).

这篇关于内置的对象层次结构在javascript中是什么样的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 12:37