I have this object that log out as in:
{0: "16407", 1: "16309", 2: "16308", 3: "16307", 4: "16306", 5: "16305", 6: "16303", 7: "16302", 8: "16301", 9: "16300", 10: "16299", 11: "16298", 12: "16297", 13: "16296", 14: "16294", 15: "16293", 16: "16292", 17: "16290", 18: "16285", 19: "16277"}
How can I restructure this to log out as follows:
{"name": "16407" }, {"name": "16309"}, {"name": "16308"}....
console.log(Object.values(o).map(v => `{"name": "${v}" }`).join(", "));but i think the question went right over my head.Object.values(o).map(v => ({name: v}))Object.values(o).map(name => ({name}))