Created
September 18, 2022 22:58
-
-
Save faustobdls/49fcec24fb1f77d128d261f27fc85e06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obj = { | |
list: [ | |
{ param1: "gasgdgasdggasd", param2: 9 }, | |
{ param1: "gasgdgasdggasd", param2: 9 }, | |
{ param1: "gasgdgasdggasd", param2: 9 }, | |
{ param1: "gasgdgasdggasd", param2: 9 }, | |
{ param1: "gasgdgasdggasd", param2: 9 }, | |
], | |
}; | |
var str = ""; | |
str = | |
str + | |
Object.keys(obj.list[0]).map((e2, i2, a2) => { | |
return `${e2}`; | |
}).join(';'); | |
str = `${str} \n`; | |
str = | |
str + | |
obj.list.map((e, i, a) => { | |
let line = Object.values(e).map((e2, i2, a2) => { | |
return `${e2}`; | |
}).join(';'); | |
return `${line} \n`; | |
}).join(''); | |
console.log(str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment