{"ScriptPreparationCode":"const myArray = [];\r\n\r\nfor (let i = 0; i \u003C 10000; i\u002B\u002B) {\r\n const obj = {\r\n prop1: \u0060value${i}_1\u0060,\r\n prop2: \u0060value${i}_2\u0060,\r\n prop3: \u0060value${i}_3\u0060,\r\n prop4: \u0060value${i}_4\u0060,\r\n };\r\n\r\n // Randomly add the metadata property\r\n if (Math.random() \u003C 0.5) {\r\n obj.metadata = {\r\n info1: \u0060metadata${i}_1\u0060,\r\n info2: \u0060metadata${i}_2\u0060,\r\n };\r\n }\r\n\r\n myArray.push(obj);\r\n}","TestCases":[{"Name":"flatMap","Code":"myArray.flatMap(obj =\u003E {\r\n if (obj.metadata) {\r\n return { prop1: obj.prop1, metadata: obj.metadata };\r\n } else {\r\n return [];\r\n }\r\n})","IsDeferred":false},{"Name":"reduce","Code":"myArray.reduce((acc, obj) =\u003E {\r\n if (obj.metadata) {\r\n acc.push({ prop1: obj.prop1, metadata: obj.metadata });\r\n }\r\n return acc;\r\n}, []);","IsDeferred":false}]}