当前位置:网站首页>Some features of ECMAScript
Some features of ECMAScript
2022-07-06 00:58:00 【sunday2018】
ECMAScript Some characteristics of
Strict mode (strict mode)
ES5 introduce . In strict mode JS The parsing and execution of will be different , Solve some ES3 Uncertain behavior in , Unsafe operation will also report errors .
Usage mode
Add the following code at the top
// Switch JS The engine is in strict mode
"use strict";
Specifies that the function executes in strict mode
function test() {
"use strict";
// ...
}
data type
ES Yes 6 Type of data :
undefined, null, boolean, number, string, object
typeof
typeof Can be used to detect the data type of variables , The returned string is
// 'undefined' Undefined
// 'boolean'
// 'string'
// 'number'
// 'object' Object or null
// 'function'
Undefined type
Undefined Variables of type have only one value , namely undefined
Use var Declare variables , But the variable is not initialized , The value of this variable is undefined.
Null type
Null Type has only one value ,null.
If the defined variable is prepared to hold the object , It is recommended to initialize the variable to null.
Object type
Object similar Java Medium Object object , Every Object Instances of types will have Object Properties and methods in classes .
- constructor, Save the function that creates the current object
- hasOwnProperty(propertyName), Check whether the given property exists in the current object instance
- isPropertypeOf(object), Check whether the incoming object is the prototype of the current object
- propertyIsEnumerable(propertyName), Check whether the attribute can be used for-in enumeration
- toLocalString()
- toString()
- valueOf()
function
No overloading , Function with the same name , The function defined later will overwrite the function defined earlier .
边栏推荐
- After Luke zettlemoyer, head of meta AI Seattle research | trillion parameters, will the large model continue to grow?
- Overview of Zhuhai purification laboratory construction details
- [groovy] compile time meta programming (AST syntax tree conversion with annotations | define annotations and use groovyasttransformationclass to indicate ast conversion interface | ast conversion inte
- [groovy] JSON serialization (jsonbuilder builder | generates JSON string with root node name | generates JSON string without root node name)
- Dede collection plug-in free collection release push plug-in
- NLP basic task word segmentation third party Library: ICTCLAS [the third party library with the highest accuracy of Chinese word segmentation] [Chinese Academy of Sciences] [charge]
- Promise
- Idea远程提交spark任务到yarn集群
- devkit入门
- [groovy] compile time metaprogramming (compile time method interception | find the method to be intercepted in the myasttransformation visit method)
猜你喜欢
Finding the nearest common ancestor of binary search tree by recursion
Questions about database: (5) query the barcode, location and reader number of each book in the inventory table
测试/开发程序员的成长路线,全局思考问题的问题......
Introduction of motor
[groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
KDD 2022 | EEG AI helps diagnose epilepsy
vSphere实现虚拟机迁移
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
如何制作自己的机器人
esxi的安装和使用
随机推荐
Ubantu check cudnn and CUDA versions
Spark获取DataFrame中列的方式--col,$,column,apply
After Luke zettlemoyer, head of meta AI Seattle research | trillion parameters, will the large model continue to grow?
MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning
Extension and application of timestamp
Keepalive component cache does not take effect
Differences between standard library functions and operators
ubantu 查看cudnn和cuda的版本
Starting from 1.5, build a micro Service Framework - call chain tracking traceid
Cf:h. maximum and [bit operation practice + K operations + maximum and]
MCU realizes OTA online upgrade process through UART
The population logic of the request to read product data on the sap Spartacus home page
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
视频直播源码,实现本地存储搜索历史记录
Hundreds of lines of code to implement a JSON parser
Gartner发布2022-2023年八大网络安全趋势预测,零信任是起点,法规覆盖更广
synchronized 和 ReentrantLock
Exciting, 2022 open atom global open source summit registration is hot
Cf:d. insert a progression [about the insert in the array + the nature of absolute value + greedy top-down]
Distributed base theory