当前位置:网站首页>Process data and change the name of data
Process data and change the name of data
2022-07-28 01:54:00 【MMNHD】

a:[
{" cell-phone number ":1321312123,' full name ':' Ah cow '},
{" cell-phone number ":888888,' full name ':' Wang Wu '},
],
b:{
' full name ':'user',
' cell-phone number ':'mobile'
}
Format to be [
{user:' Ah cow '},
{mobile:1321312123}
]
export function getImportJsData(results, header) {
const newArr = []
// All Chinese key Convert to English key Then add to the new array
results.forEach(item => {
const map = {}
Object.keys(item).forEach(key => {
map[header[key]] = item[key]
})
newArr.push(map)
})
// Time processing
newArr.forEach(item => {
Object.keys(item).forEach(key => {
if (key === 'timeOfEntry') {
item[key] = new Date(formatDate(item[key], '/'))
}
})
})
return newArr
}
getImportJsData(a,b) 
边栏推荐
猜你喜欢

周报、月报有多折磨人?万能报表模板建议收藏!(附模板)

了解Shader
![[add pictures to dice roller app]](/img/36/c5c01946bd8c4ea16ebd3f8f9b92b6.png)
[add pictures to dice roller app]

Can ordinary equipment access TSN time sensitive network?

【样式集合1】tab 栏

数商云供应链集采管理系统解决方案:集采系统管理模式,数字化管控企业物资

Graph theory analysis of white matter brain function network: neural markers for classification and prediction of depression

Lambda表达式和Stream流

IIC read / write eefprom

腾讯云HiFlow场景连接器
随机推荐
Interview question 01.08. Zero matrix
Thinking about some things
Modify the request path using the streaming API of gateway
递归相关习题
GBase 8c 事务ID和快照(三)
Dart 代码注释和文档编写规范
数字经济才是未来经济发展的核心
抓包精灵NetCapture APP抓包教程《齐全》
If you are still using WiFi, you will be out: li-fi is better!!!
MATLAB 44种动漫渐变色绘图程序
写给去不图床用户的一封信
Oracle RAC cluster file directory migration
牛客网刷题训练(三)
C language · pointer
一些事情的思考
暴雪《暗黑破坏神 4》PS5 / PS4 测试版添加到 PlayStation 数据库
Recursion related exercises
嵌入式经典通信协议
HCIP第十五天
路由策略简介