当前位置:网站首页>Differences among native objects, built-in objects, and host objects
Differences among native objects, built-in objects, and host objects
2022-07-27 21:05:00 【Liupengyuan LPY】
1、 built-in (Build-in) Objects and primitives (Naitve) The difference between objects is : The former is always created in the engine initialization phase , It's a subset of the latter ; The latter includes some objects that are created dynamically in the running process .
2、 The engine extension object is a small collection , Generally speaking, it is relatively certain , They also belong to the native objects of the engine ( But that does not belong to ECMA Canonical native objects ).
3、 The host object is not the native object of the engine , Instead, the host framework registers to JavaScript Objects in the engine .
4、 Some hosts will provide their own objects / Constructors are also known as “ Native object ”, for example Internet Explorer 7 Just provide it XMLHttpRequest() Called native —— In contrast, it was adopted in its earlier version “new ActiveXObject(‘Microsoft.XMLHTTP’)” Objects created by such methods . In this case , Readers should note “ The native object of the host ” And “ The native object of the engine ” Differences between .
One 、 Native object
ECMA-262 Put the native object (native object) Defined as “ Independent of the host environment ECMAScript Implement the provided objects ”.
Object、Function、Array、String、Boolean、Number、Date、RegExp、Error、EvalError、RangeError、ReferenceError、SyntaxError、TypeError、URIError、ActiveXObject( Server side )、Enumerator( Collection traversal class )、RegExp( Regular expressions )
From this we can see that , Simply speaking , The native object is ECMA-262 Defined classes ( Reference type ).
Two 、 Built-in objects
ECMA-262 Put built-in objects (built-in object) Defined as “ from ECMAScript Implement the provided 、 All objects independent of the host environment , stay ECMAScript Appears when the program starts executing ”. This means that developers don't have to instantiate built-in objects , It has been instantiated .
The same is “ Independent of host environment ”. By definition, it seems hard to tell “ Built-in objects ” And “ Native object ” The difference between . and ECMA-262 Only two built-in objects are defined , namely Global and Math ( They are also native objects , According to the definition , Every built-in object is a native object ).
So it's understandable . Built in objects are a kind of native objects . And it contains two kinds of objects ,Math Objects we often use , But this Global What is the object ?
Global The object is ECMAScript The most special object in , Because it doesn't really exist ! stay ECMAScript in , There is no independent function , All functions must be methods of an object .
Be similar to isNaN()、parseInt() and parseFloat() Such method , It's all functions , But in fact , They are all Global Object method . and Global Objects have more than that .
3、 ... and 、 Host object
What is the “ Host object ”? ECMAScript Medium “ host ” Of course, it is the running environment of our web pages , namely “ operating system ” and “ browser ”. All non-native objects are host objects (host object), by ECMAScript Implemented host environment provided objects .
be-all BOM and DOM Objects are all host objects . Because it's different for “ host ” The content of the environment is different . In fact, it's just ,ECMAScript Officially undefined objects belong to the host object , Because most of its undefined objects pass by themselves ECMAScript The object created by the program .TML DOM yes W3C standard ( yes HTML Short for document object model ,Document Object Model for HTML).
HTML DOM Defined for HTML A series of standard objects , And access and processing HTML Standard approach to documentation .
adopt DOM, Access to all HTML Elements , Along with the text and attributes they contain . You can modify and delete the contents , You can also create new elements .
边栏推荐
- 记一次restTemplate.getForEntity携带headers失败,restTemplate. exchange
- 自动化测试----selenium(二)
- 基于文件上传漏洞获得网站 shell 权限
- QT OpenGL makes objects move under care to form animation
- LeetCode每日一练 —— 21. 合并两个有序链表
- R语言使用lm函数构建多元回归模型(Multiple Linear Regression)、并根据模型系数写出回归方程、使用deviance函数计算出模型的残差平方和
- Global styles and icons
- Qt opengl 让物体在关照下动起来,形成动画
- 【历史上的今天】7 月 27 日:模型检测先驱出生;微软收购 QDOS;第一张激光照排的中文报纸
- CPDA | how to have data analysis thinking?
猜你喜欢

自动化测试----unittest框架

Introduction to source insight 4.0

The variable "lattice" or class "lattice.latticeeasy" (matlab) is not defined

Uncaught SyntaxError: redeclaration of let page

Hexagon_ V65_ Programmers_ Reference_ Manual(5)

82. (cesium article) cesium points move on 3D models

How to check the Bluetooth version of Bluetooth headset

Best practices for Oracle kingbasees migration of Jincang database (4. Oracle database migration practice)

Slim: self supervised point cloud scene flow and motion estimation (iccv 2021)

全局样式与图标
随机推荐
一文读懂Plato Farm的ePLATO,以及其高溢价缘由
Hcip day 5
14 day Hongmeng device development practice - Chapter 7 device networking cloud learning notes
Airiot Q & A issue 6 | how to use the secondary development engine?
LeetCode每日一练 —— 876. 链表的中间结点
A lock faster than read-write lock. Don't get to know it quickly
自动化测试----unittest框架
Leetcode-136-a number that appears only once
Brief description of tenant and multi tenant concepts in cloud management platform
Riding lantern case
Elk too heavy? Try KFC log collection
82. (cesium article) cesium points move on 3D models
如何解决tp6控制器不存在:app\controller\Index
北京/上海/广州/深圳DAMA-CDGA/CDGP数据治理认证报名条件
怎样实现文档协同?
How to check the Bluetooth version of Bluetooth headset
认识网络模型TCPIP模型
MySQL design optimization generates columns
重复的DNA序列[hash判定重复+滑动窗口+二进制编码之位运算]
人脸识别5.1- insightface人脸检测模型训练实战笔记