当前位置:网站首页>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) 
边栏推荐
- Custom events
- QT setting Icon
- Brushes and brushes
- Realize OCR language recognition demo (II) - display and interaction of pictures and recognition content
- Niuke multi School Game 3 A, c+ weight segment tree
- 马克的故事
- Thinking about some things
- 递归的使用:1.将平铺数组转为树 2.将树转化为平铺数组
- Lambda表达式和Stream流
- N32L43x Flash读\写\擦除操作总结
猜你喜欢

【向 Dice Roller 应用添加图片】

Load balancing SLB

"Do you" want to be a test / development programmer? We strive to sprout

网易云仿写

了解Shader

Brushes and brushes

Niuke net question brushing training (III)

ue4 unreal NDisplay插件 简易使用 三折幕 详细...

Leetcode high frequency question 128. the longest continuous sequence, which is often tested in interviews with Internet companies

Collection / container
随机推荐
VLAN experiment
Modify the request path using the streaming API of gateway
Dart code comments and documentation specification
“你“想当测试/开发程序员吗?努力发芽的我们......
阿门的故事
小散量化炒股记|量化系统中数据是源头,教你搭建一款普适的数据源框架
2022软件测试技能 Robotframework + SeleniumLibrary + Jenkins web关键字驱动自动化实战教程
使用Gateway的流式api修改请求路径
Establishment of elk log analysis system
【向 Dice Roller 应用添加图片】
【分布式开发】之 CAP 原则
Redis 5 种基本数据结构
2.2 comprehensive application questions - sequence table
For newly installed PIP3, use no module named 'LSB_ Release 'problem
Load balancing SLB
阿虎的故事
文章复现:超分辨率网络FSRCNN
爬虫学习的一个综合案例——访问网站
Favorite songs
GBase 8c 事务ID和快照