当前位置:网站首页>[circular array] JS method collection of circular array
[circular array] JS method collection of circular array
2022-07-25 02:22:00 【Ma Xiaotiao's coding advanced road】
One 、forEach loop
notes : No, return Return value , And can't use break Out of the loop .
let arrlist = ['123','456','789'];
arrlist.forEach(function (value, index) {
//value It's every item ,index It's the index
console.log(value,index);
});
Two 、for loop
notes : This is the most basic way of circulation , You can use return End .
for(var i = 0;i < 10; i++){
console.log(i) // in every particular
}
3、 ... and 、map loop
notes : Map the original array into a new array , The original array will not be manipulated , Return a new array . Support return return .
let arrlist = ['111','222','333'];
arrlist.map(function(value,index){
//value in every particular ,index Indexes
console.log(value,index);
});
Four 、for of loop
notes : yes ES6 New loop method . You can respond to break、continue and return End . Support array , Class array objects are also supported .
let arrlist = ['111','222','333'];
for(let item of arrlist){
console.log(item); //item Refers to each item of the array .
}
// Output '111' '222' '333'
Ongoing update ~
边栏推荐
- Guide to the construction of network security testing laboratory - Chapter 1, section 1.5 key terms
- When does MySQL use table locks and row locks?
- It's still a synchronization problem
- Keepalivetime=0 description of ThreadPoolExecutor
- Introduction to ORM framework - what is ORM framework?
- When executing SQL query statements in MySQL database, the underlying implementation principle (ultra detailed)
- A bit of knowledge - websites about scripts
- 1260. Two dimensional grid migration: simple construction simulation problem
- Jenkins configuration plug-in interface displays "suggestions collection" in Chinese
- Industrial control safety PLC firmware reverse II
猜你喜欢

BMW I3 based on clar architecture is not a simple "oil to electricity" product

Fraud detection using CSP

"Ask the sky" is in place! Yu Jingchuan's "China Space Station" in 2013 is about to set sail in the sea of stars
Failed to create data snapshot: lock file [/siyuan/data/assets/image- 2022070216332-jijwccs.png failed: open /siyuan/data/assets/image- 2022070216332-jijwccs.png: permission denied; unable to lock fil
![[leetcode] 3. Longest substring without repeated characters - go language problem solution](/img/63/57d3557d77d44b51b7d0f71669568f.png)
[leetcode] 3. Longest substring without repeated characters - go language problem solution

Apk packaging process
![ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience](/img/26/18fd3106f887f503479f081e29dac3.jpg)
ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience

R language uses logistic regression, ANOVA, outlier analysis and visual classification iris iris data set

"Nowadays, more than 99.9% of the code is garbage!"

How to use ES6 async and await (basic)
随机推荐
[recognize cloud Nativity] Chapter 4 cloud network section 4.9.4.3 - smart network card usage scenario - network acceleration implementation
Project management tool Zen
MySQL advanced (13) command line export import database
xts performance auto fix script
"Nowadays, more than 99.9% of the code is garbage!"
Peripherals: timer, watchdog and RTC
Jenkins configuration plug-in interface displays "suggestions collection" in Chinese
Creating elements of DOM series
Gerrit statistics script
Ecosystem long-term observation data product system
Solution to the occupation of project startup port
Standard transfer function
[hero planet July training leetcode problem solving daily] 20th BST
Management mode of agricultural science data center based on life cycle theory
Android memory optimized disk cache
Eolink - quickly develop interfaces through document driven
The importance of system to Philosophy Hegel
Experienced the troubleshooting and solution process of an online CPU100% and the application of oom
Apk packaging process
My creation anniversary (3rd Anniversary)