当前位置:网站首页>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);
边栏推荐
- [2022] Jiangxi postgraduate mathematical modeling scheme and code
- 端口号和进程号的区别?
- P6773 [noi2020] destiny (DP, segment tree merging)
- Leetcode(524)——通过删除字母匹配到字典里最长单词
- Is there any discount for opening an account now? In addition, is it safe to open a mobile account?
- Qu'est - ce que le PMP?
- Static domain and static method
- 我想知道股票开户怎么开户?究竟网上开户是否安全么?
- 如何在智汀中实现智能锁与灯、智能窗帘电机场景联动?
- How to realize the scene linkage of intelligent lock, lamp and intelligent curtain motor in zhiting?
猜你喜欢

SWT/ANR问题--StorageManagerService卡住

Find the length of the common part of two line segments

Qu'est - ce que le PMP?

機器學習10-信念貝葉斯分類器

QML control type: tooltip

(summary I) Halcon Foundation's target finding features + becoming a regular

SWT / anr problem - storagemanagerservice stuck

PMP是什麼?

机器学习9-通用逼近器径向基函数神经网络,在新观点下审视PDA和SVM

项目管理是什么?
随机推荐
How to select securities companies? In addition, is it safe to open a mobile account?
@ConfigurationProperties和@Value的区别
手机edge浏览器无法打开三方应用
P6773 [noi2020] destiny (DP, segment tree merging)
[proteus simulation] Arduino UNO +74c922 keyboard decoding drive 4x4 matrix keyboard
Rocketqa: cross batch negatives, de noised hard negative sampling and data augmentation
Go import self built package
@The difference between configurationproperties and @value
十大劵商如何开户?还有,在线开户安全么?
AS400 API 从零到一的整个历程
Do you write API documents or code first?
SWT / anr problem - anr/je causes SWT
静态域与静态方法
RocketQA:通过跨批次负采样(cross-batch negatives)、去噪的强负例采样(denoised hard negative sampling)与数据增强(data augment
Short message sending solution in medical his industry
最新微信ipad协议 CODE获取 公众号授权等
求两个线段公共部分的长度
[JS] [Nuggets] get people who are not followers
2022年最新csdn涨薪技术栈-app自动化测试概述
There is no future to be expected. It is just the last fantasy of a migrant worker before he dies