let obj = { links: ["https://somelink.com/image.jpg", "https://somelink.com/image2.jpg"], IDs: ["yCmj", "4q1K"], }
let newObj = { templates: [ {id:"yCmj", link: "https://somelink.com/image.jpg"}, {id:"4q1K", link: "https://somelink.com/image2.jpg"} ] }
let templates = obj.templateIDs.map((id) => ({id})) templates = obj.thumbnailLinks.map((thumbnailLink) => ({thumbnailLink})) let newObj = templates
let newObj = { templates: obj.IDs.map((id, index) => ({ id, link: obj.links[index] })) };
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)