当前位置:网站首页>map数组函数
map数组函数
2022-07-01 02:19:00 【kilito_01】
// Map 数组方法
function map(arr,callback){
let result = [];
for (let i = 0; i < arr.length; i++) {
result.push(callback(arr[i]))
}
return result
}
// 测试
const arr = [1,2,3,4,5]
const result = map(arr,(item,index)=>{
return item *10;
})
console.log(result);
边栏推荐
- Upstream and downstream in software development
- 小程序云开发之--微信公众号文章采集篇
- PMP是什么?
- When facing the industrial Internet, they even use the ways and methods of consuming the Internet to land and practice the industrial Internet
- Is there any discount for opening an account now? In addition, is it safe to open a mobile account?
- halcon变量窗口的图像变量不显示,重启软件和电脑都没用
- Analysis on user behavior loss of data exploration e-commerce platform
- [proteus simulation] Arduino UNO +74c922 keyboard decoding drive 4x4 matrix keyboard
- 删除重复的电子邮箱
- FL studio20.9 fruit software advanced Chinese edition electronic music arrangement
猜你喜欢

The mobile edge browser cannot open the third-party application
![SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]](/img/91/0efbc13597be4dba5b9cf4e8644e35.png)
SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]

VirtualBox installation enhancements

聚焦绿色低碳,数据中心散热进入“智能冷却”新时代

【2022年】江西省研究生数学建模方案、代码

LabVIEW计算相机图像传感器分辨率以及镜头焦距

Qu'est - ce que le PMP?

There is no future to be expected. It is just the last fantasy of a migrant worker before he dies

Ernie-gram, 显式、完备的 n-gram 掩码语言模型,实现了显式的 n-gram 语义单元知识建模。

(translation) use eyebrow shaped text to improve Title click through rate
随机推荐
Zero foundation self-study SQL course | window function
SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]
VirtualBox installation enhancements
CorelDRAW 2022中文精简64位直装版下载
聚焦绿色低碳,数据中心散热进入“智能冷却”新时代
Delete duplicate email
Alphabet-Rearrange-Inator 3000(字典树自定义排序)
十大券商有哪些?另外想问,现在在线开户安全么?
centos 安装多个版本的php并切换
Leetcode (524) -- match the longest word in the dictionary by deleting letters
零基础自学SQL课程 | 窗口函数
go导入自建包
SWT/ANR问题--ANR/JE引发SWT
Some uses of Halcon array
C#生成putty格式的ppk文件(支持passphrase)
How to realize the scene linkage of intelligent lock, lamp and intelligent curtain motor in zhiting?
Short video platform development, relying on drawerlayout to achieve side sliding menu effect
(翻译)实时内联验证更容易让用户犯错的原因
运算符重载的初识
Leetcode 面试题 17.10. 主要元素