{"ScriptPreparationCode":"const data = [\r\n {\r\n fields: {\r\n internalName: \u0022__NAME__\u0022,\r\n targetCategoryId: [\u00221\u0022, \u00222\u0022, \u00223\u0022, \u00224\u0022],\r\n textColor: \u0022#FFFFFF\u0022\r\n },\r\n },\r\n {\r\n fields: {\r\n internalName: \u0022__NAME__\u0022,\r\n targetCategoryId: [\u00221\u0022, \u00222\u0022, \u00223\u0022, \u00224\u0022],\r\n textColor: \u0022#FFFFFF\u0022\r\n },\r\n },\r\n];","TestCases":[{"Name":"Reduce \u002B for of","Code":" (() =\u003E {\r\n return data.reduce(\r\n (acc, cur) =\u003E {\r\n for (const id of cur.fields.targetCategoryId) {\r\n acc[id] = { textColor: cur.fields.textColor };\r\n }\r\n return acc;\r\n },\r\n {},\r\n );\r\n })();","IsDeferred":false},{"Name":"Map, nested for of \u002B Object.fromEntries","Code":" (() =\u003E {\r\n const configurationMap = new Map();\r\n for (const configuration of data) {\r\n for (const id of configuration.fields.targetCategoryId) {\r\n configurationMap.set(id, { textColor: configuration.fields.textColor });\r\n }\r\n }\r\n\r\n return Object.fromEntries(configurationMap);\r\n })();","IsDeferred":false}]}