当前位置:网站首页>JS array object to object
JS array object to object
2022-06-25 01:44:00 【Э Time walker to me】
Convert the data of an array object into a normal object key value pair key:value In the form of

let arr = [
{
id:'1',employeeNo:'110',name:' Zhang San '},
{
id:'2',employeeNo:'111',name:' Li Si '},
{
id:'3',employeeNo:'112',name:' Wang Wu '},
{
id:'4',employeeNo:'113',name:' Zhang Yu '},
{
id:'5',employeeNo:'114',name:' Xiaohong '},
]
let newObj = {
}
arr.map(item => {
newObj[item.employeeNo] = item.name // It can be spliced according to your own needs
})
console.log(newObj) // {110: ' Zhang San ', 111: ' Li Si ', 112: ' Wang Wu ', 113: ' Zhang Yu ', 114: ' Xiaohong '}
console.log(newObj[112]) // ' Wang Wu '
边栏推荐
- PS5连接OPPO K9电视不支持2160P/4K
- 胰蛋白酶中英文说明书
- Tencent has completed the comprehensive cloud launch to build the largest cloud native practice in China
- Listen to the markdown file and hot update next JS page
- Cloud development technology summit · public welfare programming challenge [hot registration]!
- 数组中关于sizeof()和strlen
- [live review] 2022 Tencent cloud future community city operator recruitment conference and SaaS 2.0 new product launch!
- js数组对象转对象
- 带马尔科夫切换的正向随机微分方程数值格式模拟
- Chinese and English instructions of Papain
猜你喜欢

Bi-sql Union

Abnova CSV magnetic beads description in Chinese and English

Use redis' sorted set to make weekly hot Reviews

Bi SQL drop & alter

论文翻译 | RandLA-Net: Efficient Semantic Segmentation of Large-Scale Point Clouds

Multi modal data can also be Mae? Berkeley & Google proposed m3ae to conduct Mae on image and text data! The optimal masking rate can reach 75%, significantly higher than 15% of Bert
![uni-app集成极光推送插件后真机调试提示“当前运行的基座不包含原生插件[JG-JPush]...”问题的解决办法](/img/8b/0e982711c225ec8b0a2b90819d8a11.png)
uni-app集成极光推送插件后真机调试提示“当前运行的基座不包含原生插件[JG-JPush]...”问题的解决办法

void* 指针

Bi-sql select into

Google browser console F12 how to set the Chinese / English switching method, we must see the last!!!
随机推荐
JVM directive
IPC mechanism
多模态数据也能进行MAE?伯克利&谷歌提出M3AE,在图像和文本数据上进行MAE!最优掩蔽率可达75%,显著高于BERT的15%
uni-app集成极光推送插件后真机调试提示“当前运行的基座不包含原生插件[JG-JPush]...”问题的解决办法
2种常见的设备稼动率OEE监测方法
天书夜读笔记——内存分页机制
谷歌浏览器控制台 f12怎么设置成中文/英文 切换方法,一定要看到最后!!!
Reading notes at night -- deep into virtual function
为猪脸识别而进行自己数据集的构建、训练「建议收藏」
Bi skill - judge 0 and null
Listen to the markdown file and hot update next JS page
mpls 笔记 part 1
JVM指令
Status quo analysis: how "one cloud and multi-core" can promote the rapid deployment of information innovation projects
Hands on data analysis data modeling and model evaluation
String common methods
数组中关于sizeof()和strlen
Abnova 5-methylcytosine polyclonal antibody
(CVPR 2020) Learning Object Bounding Boxes for 3D Instance Segmentation on Point Clouds
Unity C# 网络学习(六)——FTP(二)