当前位置:网站首页>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 .
边栏推荐
- Do you know about data synchronization?
- Things about stack migration
- Codeforces 1706e merge + heuristic merge + st table
- 自定义学习率
- 二舅,为什么火了?
- CPDA|如何拥有数据分析思维?
- QT OpenGL makes objects move under care to form animation
- Hexagon_V65_Programmers_Reference_Manual(9)
- [Numpy] 广播机制(Broadcast)
- [today in history] July 27: model testing pioneer was born; Microsoft acquires qdos; The first laser typesetting Chinese newspaper
猜你喜欢
![[deep learning] pytoch torch Autograd automatic differential engine](/img/c8/2ce1e5c02283965f8690ac5a9971a9.png)
[deep learning] pytoch torch Autograd automatic differential engine

Ue5 uses DLSS (super sampling) to improve the FPS of the scene away from the optimization scheme of Caton

LeetCode-209-长度最小的子数组

Source Insight 4.0使用介绍

命令行 PDF 转换器:::fCoder 2PDF

Hexagon_V65_Programmers_Reference_Manual(5)

LeetCode每日一练 —— 206. 反转链表

知识管理系统推动企业信息化发展

二舅,为什么火了?

Hexagon_V65_Programmers_Reference_Manual(6)
随机推荐
Face recognition 5.1- insightface face face detection model training practice notes
[Numpy] 广播机制(Broadcast)
API Gateway介绍
How to talk to CIO / CTO
全局样式与图标
北京/上海/广州/深圳DAMA-CDGA/CDGP数据治理认证报名条件
How to check the Bluetooth version of Bluetooth headset
LeetCode每日一练 —— 21. 合并两个有序链表
Academic sharing | Tsinghua University, Kang Chongqing: power system carbon measurement technology and application (matlab code implementation)
Hexagon_V65_Programmers_Reference_Manual(9)
LeetCode每日一练 —— 876. 链表的中间结点
基于文件上传漏洞获得网站 shell 权限
品牌列表案例
User login switching case
Openresty Lua resty DNS domain name resolution
MySQL design optimization generates columns
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组加和值(sum)
Chapter 7 Intermediate Shell Tool I
如何让个性化推荐即刻触达?云原生数据库GaussDB(for Redis)来助力
Repeated DNA sequence [hash determination repetition + sliding window + bit operation of binary coding]