{"ScriptPreparationCode":"var raw = new Array(250).fill({\r\n id: \u0027gid://something/Something/something\u0027,\r\n handle: \u0027something\u0027,\r\n name: \u0027Something\u0027,\r\n categories: [\u0027SOMETHING\u0027],\r\n lastViewedAt: \u00272022-03-18T21:30:18Z\u0027,\r\n isPinned: false,\r\n});","TestCases":[{"Name":"flatMap","Code":"const flatMapped = raw.flatMap(({ id, categories, handle, name, lastViewedAt, isPinned }) =\u003E {\r\n if (categories.length === 0) {\r\n return [];\r\n }\r\n\r\n return {\r\n category: categories[0],\r\n handle,\r\n url: \u0022https://google.com/\u0022,\r\n name,\r\n lastViewedAt: lastViewedAt == null ? null : new Date(lastViewedAt),\r\n author: \u0022someone\u0022,\r\n isPinned,\r\n type: \u0022something\u0022,\r\n gid: id,\r\n };\r\n});","IsDeferred":false},{"Name":"reduce","Code":"const reduced = raw.reduce(function (array, { id, categories, handle, name, lastViewedAt, isPinned }) {\r\n if (categories.length === 0) {\r\n return array;\r\n }\r\n\r\n array.push({\r\n category: categories[0],\r\n handle,\r\n url: \u0022https://google.com/\u0022,\r\n name,\r\n lastViewedAt: lastViewedAt == null ? null : new Date(lastViewedAt),\r\n author: \u0022someone\u0022,\r\n isPinned,\r\n type: \u0022something\u0022,\r\n gid: id,\r\n });\r\n return array;\r\n}, []);","IsDeferred":false}]}