当前位置:网站首页>Loop traversal of foreach and some of ES6
Loop traversal of foreach and some of ES6
2022-07-27 10:26:00 【Ride my beloved little motorcycle】
1.foreach Loop traversal
Go straight to the code :
result.value.forEach((item,index)=>{
console.log(index);
})
about return,break It doesn't work
2.some Loop traversal of
let arr = [1,2,3,4,5,6,7]
if (arr.some((item,index) => {
console.log(index);
if(item > 3){
// Jump out when conditions are met
return true;
}
})) {
// return;
console.log("return Later code .");
}
console.log(" Later code .");
The printed result is :
1
2
3
return Later code .
Later code .
边栏推荐
猜你喜欢

Huawei switch dual uplink networking smart Link Configuration Guide

Multipoint bidirectional republication and routing strategy

关于ETL的两种架构(ETL架构和ELT架构)

Oracle resizing data files
[email protected]、$?、env看所有的全局变量值、set看所有变量"/>Shell变量、系统预定义变量$HOME、$PWD、$SHELL、$USER、自定义变量、特殊变量$n、$#、$*、[email protected]、$?、env看所有的全局变量值、set看所有变量

Shell read read console input, use of read

How to turn off the application of computer self startup

Stylegan paper notes + modify code to try 3D point cloud generation

gyp ERR! configure error. gyp ERR! stack Error: gyp failed with exit code: 1

Samba server
随机推荐
samba服务器
Huawei switch dual uplink networking smart Link Configuration Guide
open3d库的安装,conda常用指令,导入open3d时报这个错误Solving environment: failed with initial frozen solve. Retrying w
hdu5289(Assignment)
hdu5288(OO’s Sequence)
Discussion on a problem
女粉想要找男朋友,竟是为了...
Matlab sound classification based on short-time neural network
RobotFramework+Eclispe环境安装篇
Metaspolit
[brother hero June training] day 25: tree array
There is no CUDA option in vs2019+cuda11.1 new project
File upload vulnerability bypass method
Mathematical reasoning: five couples get together and shake hands when they meet
Pygame: alien invasion
数据库性能系列之子查询
FSM onehot answer record
Text processing tool in shell, cut [option parameter] filename Description: the default separator is the built-in variable of tab, awk [option parameter] '/pattern1/{action1}filename and awk
【精选】如何完美的写 PHP 代码的呢?
Wind10 configure ADB command