Published
- 1 min read
turn object`s properties into array of objects js
The solution for this is noted below
turn object`s properties into array of objects js
Solution
let data = {
1536135941922: 'true',
1536135962942: 'false',
1536135986966: 'false',
1536135989968: 'true'
}
let result = Object.entries(data).map(([k, v]) => ({ [k]: v }))
console.log(result)
Try other methods by searching on the site. That is if this doesn’t work