当前位置:网站首页>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 .
边栏推荐
- R语言dplyr包summarise_at函数计算dataframe数据中多个数据列(通过向量指定)的计数个数、均值和中位数、使用list函数指定函数列表(使用.符号和~符号指定函数语法purr)
- Introduction to rk3399 platform introduction to proficient series (Introduction) 21 day learning challenge
- 如何对话CIO/CTO
- How to solve the problem that tp6 controller does not exist: app\controller\index
- 人脸识别5.1- insightface人脸检测模型训练实战笔记
- MySQL design optimization generates columns
- 搭建discuz论坛并攻破盗取数据库
- Codeforces 1706E 并查集 + 启发式合并 + ST 表
- Chapter 7 Intermediate Shell Tool I
- API Gateway介绍
猜你喜欢

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

Typroa 拼写检查: 缺少对于 中文 的字典文件
![[Numpy] 广播机制(Broadcast)](/img/1f/8d61ac7b35a82067bc0b77426590eb.png)
[Numpy] 广播机制(Broadcast)

Hexagon_ V65_ Programmers_ Reference_ Manual(6)

品牌列表案例

用户登录切换案例

IOU 目标跟踪其二:VIOU Tracker

SLIM:自监督点云场景流与运动估计(ICCV 2021)
![[numpy] array index and slice](/img/ce/34db7aef3fefe8a03e638d0838492f.png)
[numpy] array index and slice

LeetCode-209-长度最小的子数组
随机推荐
R语言使用epiDisplay包的power.for.2p函数进行效用分析 ( 效能分析、Power analysis)、给定两个样本的比例值(proportions)、样本量计算效用值
Chapter 7 Intermediate Shell Tool I
Hexagon_ V65_ Programmers_ Reference_ Manual(5)
R语言使用epiDisplay包的lroc函数可视化logistic回归模型的ROC曲线并输出诊断表(diagnostic table)、可视化多条ROC曲线、使用legend函数为可视化图像添加图例
Hexagon_ V65_ Programmers_ Reference_ Manual(6)
Brand list cases
云管平台中租户以及多租户概念简单说明
认识网络模型网络模型概述
人脸识别5.1- insightface人脸检测模型训练实战笔记
DJI push code (one code for one use, updated on July 26, 2022)
Where is the program?
SLIM:自监督点云场景流与运动估计(ICCV 2021)
AIRIOT答疑第6期|如何使用二次开发引擎?
Know the transmission medium, the medium of network communication
五大知名人士对于AI的忧虑
Hexagon_V65_Programmers_Reference_Manual(6)
opencv实现图片裁剪和缩放
用户登录切换案例
认识传输介质物理层概述
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组加和值(sum)