Public
Script
1
2
3
4
5
6
7
8
9
export function jsonArrayToJsonL(arr: Array<any>) {
let output = "";
for (const item of arr) {
output += `${JSON.stringify(item)}\n`;
}
return output;
}
// console.log(jsonArrayToJsonL([{ a: "b" }, [{ c: "d" }]]));
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 15, 2024