当前位置:网站首页>Es2016 key summary
Es2016 key summary
2022-06-30 04:10:00 【Runqing】
1.Array.prototype.includes
before:
Use Array.prototype.indexOf() To determine whether the array contains an element , Because this method returns the first index of a given element that can be found in the array , If it doesn't exist , Then return to -1.
const beasts = ['ant', 'bison', 'camel', 'duck', 'bison'];
console.log(beasts.indexOf('bison'));
// expected output: 1
// start from index 2
console.log(beasts.indexOf('bison', 2));
// expected output: 4
console.log(beasts.indexOf('giraffe'));
// expected output: -1
after:
Array.prototype.includes() Method is used to determine whether an array contains a specified value , According to the circumstances , Return if included true, Otherwise return to false.
const array1 = [1, 2, 3];
console.log(array1.includes(2));
// expected output: true
const pets = ['cat', 'dog', 'bat'];
console.log(pets.includes('cat'));
// expected output: true
console.log(pets.includes('at'));
// expected output: false
2. Index of operation
before:
Math.pow() Function returns cardinality (base) The index of (exponent) The next power , namely baseexponent.
console.log(Math.pow(7, 3));
// expected output: 343
console.log(Math.pow(4, 0.5));
// expected output: 2
console.log(Math.pow(7, -2));
// expected output: 0.02040816326530612
// (1/49)
console.log(Math.pow(-7, 0.5));
// expected output: NaN
after:
Use **
console.log(7 ** 3)
// expected output: 343
console.log(4 ** 0.5)
// expected output: 2
console.log(7 ** -2)
// expected output: 0.020408163265306124
console.log((-7) ** 0.5)
// expected output: NaN
边栏推荐
- lego_ Reading and summary of loam code
- (04).NET MAUI实战 MVVM
- 巧用 Bitmap 实现亿级海量数据统计
- Cloud native -- websocket of Web real-time communication technology
- Simple theoretical derivation of SVM (notes)
- I get n offers in two months. I don't have any difficult interviewers here
- Daily summary of code knowledge
- dotnet-exec 0.5.0 released
- Linear interpolation of spectral response function
- Indefinite parameters of JS function
猜你喜欢
![[note] Introduction to data analysis on June 7, 2022](/img/8b/9119bfdd10227f5c29ca2ece192880.png)
[note] Introduction to data analysis on June 7, 2022

【论文阅读|深读】DANE:Deep Attributed Network Embedding
![[note] May 23, 2022 MySQL](/img/a1/dd71610236729e1d25c4c3e903c0e0.png)
[note] May 23, 2022 MySQL

RPC correction

Wang Shuang - assembly language learning summary

Day 12 advanced programming techniques

El upload Upload file (Manual upload, Automatic upload, upload progress)

The school training needs to make a registration page. It needs to open the database and save the contents entered on the registration page into the database
![[summary of skimming questions] database questions are summarized by knowledge points (continuous update / simple and medium questions have been completed)](/img/89/fc02ce355c99031623175c9f351790.jpg)
[summary of skimming questions] database questions are summarized by knowledge points (continuous update / simple and medium questions have been completed)

When easycvr deploys a server cluster, what is the reason why one is online and the other is offline?
随机推荐
第九天 脚本与资源管理
2021-11-04
Use ideal to connect to the database. The results show some warnings. How to deal with this part
Semantic segmentation resources
Knowledge - how to build rapport in sales with 3 simple skills
dotnet-exec 0.5.0 released
DRF -- nested serializer (multi table joint query)
Day 11 script and game AI
NER中BiLSTM-CRF解读score_sentence
After the win10 system uses the browser to download, the content is moved or deleted without reason
Jour 9 Gestion des scripts et des ressources
[operation] MySQL query on May 24, 2022
El upload upload file (manual upload, automatic upload, upload progress)
Everyone, Flink 1.13.6, mysql-cdc2.2.0, the datetime (6) class extracted
(Reprinted) an article will take you to understand the reproducing kernel Hilbert space (RKHS) and various spaces
Unity échappe à l'entrée de caractères lors de l'entrée de chaînes dans l'éditeur
第十一天 脚本与游戏AI
关于智能视觉组上的机械臂
Titanic(POJ2361)
Huawei cloud native - data development and datafactory