当前位置:网站首页>[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 ~
边栏推荐
- Speed comparison between 64 bit width and 32 bit width of arm64 memory
- H5 common positioning function package
- Start to build a three node Eureka cluster
- 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
- Introduction to ORM framework - what is ORM framework?
- G024-db-gs-ins-01 openeuler deployment opengauss (single instance)
- "I gave up programming and wrote a 1.3 million word hard science fiction."
- Beijing Zhun electric clock, Beidou clock server, GPS network time server, NTP satellite timing system
- Automatically create partition tables by time and month in PostgreSQL
- Query the thread information of MySQL server (detailed explanation)
猜你喜欢

Start to build a three node Eureka cluster

Chinese son-in-law OTA Ono became the first Asian president of the University of Michigan, with an annual salary of more than 6.5 million!

Vs2019 configuring Qt5 development environment

Use Fiddler to capture apps
Windows Server 2022 received a non security update in July: fix the sticking problem caused by defender

See you in Suzhou! "Cloud Intelligence Technology Forum - industry special" will be held soon

Coal industry supply chain centralized mining system: digitalization to promote the transformation and upgrading of coal industry

Speed comparison between 64 bit width and 32 bit width of arm64 memory

Using ODBC to consume SAP ABAP CDs view in Excel

Thinkphp5.0.24 deserialization chain analysis
随机推荐
G024-db-gs-ins-01 openeuler deployment opengauss (single instance)
Common functional interfaces_ Predicate interface_ Default method and and predicate interface exercise_ Set interface filtering
Vs2019 configuring Qt5 development environment
Mobile Robotics (3) Kalman filter
My creation anniversary (3rd Anniversary)
It's still a synchronization problem
ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
Simulate the implementation of strstr
Google launched another "man grabbing war" for core making, and Intel's 17 year veteran joined!
Use SAP ui5 application to consume create and delete operations of OData in business application studio
Windows Server 2022 received a non security update in July: fix the sticking problem caused by defender
About the relationship between parent process and child process (UAC bypass idea)
How to judge which star you look like?
Remote sensing image classification tool and visualization application of WebGIS
In the post deep learning era, where is the recommendation system going?
How can arm access the Internet through a laptop?
Explorer TSSD 2019 software installation package download and installation tutorial
Unable to display spline in UE4 (unreal engine4) terrain editing tool
Four redis cluster schemes you must know and their advantages and disadvantages
Today in history: the kotlin language was published for the first time; The father of the IMAP agreement was born; CT imaging achieves a new breakthrough