当前位置:网站首页>JS traversal array and string
JS traversal array and string
2022-07-06 21:10:00 【viceen】
js Traversal array of 、 character string
1、 Traversal array
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Traversal array </title>
</head>
<body>
<script> const arr = [11, 22, 33, 44, 55, 66] // Create array // Traversal array for (let i = 0; i < arr.length; i++) {
console.log(arr[i]) } // Traversal array for (let key in arr) {
console.log(key + '---' + arr[key]) } // Traversal array for (let key of arr) {
console.log(key); } // Traversal array </script>
</body>
</html>
2、 Traversal string
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Traversal string </title>
</head>
<body>
<script> let data1 = " Hello , hi , hello ,Hi,Hello, I'm very glad to "; let arr1 = data1.split(","); // String to array ( adopt ",") console.log("arr1:", arr1); for (let i = 0; i < arr1.length; i++) {
console.log(arr1[i]) } </script>
</body>
</html>
边栏推荐
- Why do job hopping take more than promotion?
- Taylor series fast Fourier transform (FFT)
- 过程化sql在定义变量上与c语言中的变量定义有什么区别
- 数据湖(八):Iceberg数据存储格式
- Dynamically switch data sources
- SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
- ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
- Pat 1078 hashing (25 points) ⼆ times ⽅ exploration method
- 【Redis设计与实现】第一部分 :Redis数据结构和对象 总结
- 全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
猜你喜欢

2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history
![[MySQL] basic use of cursor](/img/cc/39b1e17b48d0de641d3cbffbf2335a.png)
[MySQL] basic use of cursor

Performance test process and plan

【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug

Variable star --- article module (1)

##无yum源安装spug监控

HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother

3D face reconstruction: from basic knowledge to recognition / reconstruction methods!

Swagger UI教程 API 文档神器

【滑动窗口】第九届蓝桥杯省赛B组:日志统计
随机推荐
如何实现常见框架
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
Three schemes of SVM to realize multi classification
代理和反向代理
基于深度学习的参考帧生成
@Detailed differences among getmapping, @postmapping and @requestmapping, with actual combat code (all)
Opencv learning example code 3.2.3 image binarization
过程化sql在定义变量上与c语言中的变量定义有什么区别
OneNote 深度评测:使用资源、插件、模版
OneNote in-depth evaluation: using resources, plug-ins, templates
PG基础篇--逻辑结构管理(事务)
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
Forward maximum matching method
966 minimum path sum
Deployment of external server area and dual machine hot standby of firewall Foundation
el-table表格——获取单击的是第几行和第几列 & 表格排序之el-table与sort-change、el-table-column与sort-method & 清除排序-clearSort
3D人脸重建:从基础知识到识别/重建方法!
C language games - minesweeping