{"ScriptPreparationCode":"fn = (val, key) =\u003E val.toString()\r\nobj = Object.fromEntries([...Array(10000)].map((v, i) =\u003E ([i\u002B1, i\u002B1])))","TestCases":[{"Name":"Reduce \u002B spread","Code":" const keys = Object.keys(obj);\r\n return keys.reduce((carry, key) =\u003E ({ ...carry, [key]: fn(obj[key], key) }), {});","IsDeferred":false},{"Name":"Loop (for...in) with .keys()","Code":" const keys = Object.keys(obj);\r\n let result = {};\r\n for (let key of keys) {\r\n result[key] = fn(obj[key], key);\r\n }\r\n return result;\r\n","IsDeferred":false},{"Name":"Loop (for...in) with .entries()","Code":" const entries = Object.entries(obj);\r\n let result = {};\r\n for (let [key, value] of entries) {\r\n result[key] = fn(value, key);\r\n }\r\n return result;\r\n","IsDeferred":false},{"Name":"Reduce \u002B mutate","Code":" const keys = Object.keys(obj);\r\n return keys.reduce((carry, key) =\u003E (carry[key] = fn(obj[key], key)), {});","IsDeferred":false},{"Name":"Reduce \u002B mutate with entries()","Code":" const entries = Object.entries(obj);\r\n return entries.reduce((carry, [key, value]) =\u003E (carry[key] = fn(value, key)), {});","IsDeferred":false},{"Name":"Map with fromEntries","Code":"Object.fromEntries(\r\n Object.entries(obj).map(([key, value]) =\u003E [key, fn(value, key)])\r\n)","IsDeferred":false},{"Name":"Loop (for...in) with mutate","Code":" const result = { ...obj };\r\n\r\n for (const key in result) {\r\n if (result[key]) {\r\n result[key] = fn(result[key], key);\r\n }\r\n }","IsDeferred":false},{"Name":"Loop (for...in) with mutate (Object.assign)","Code":" const result = Object.assign({}, obj);\r\n\r\n for (const key in result) {\r\n if (result[key]) {\r\n result[key] = fn(result[key], key);\r\n }\r\n }","IsDeferred":false},{"Name":"Loop (for...in) with mutate (save object[key])","Code":" const result = { ...obj };\r\n\r\n for (const key in result) {\r\n const value = result[key]\r\n if (result[key]) {\r\n result[key] = fn(result[key], key);\r\n }\r\n }","IsDeferred":false},{"Name":"Loop (for...in) with unsafe mutate","Code":" for (const key in obj) {\r\n if (obj[key]) {\r\n obj[key] = fn(obj[key], key);\r\n }\r\n }","IsDeferred":false},{"Name":"Object.fromEntries with map","Code":"Object.fromEntries(Object.entries(obj).map(([key, value]) =\u003E {\r\n return [key, fn(value, key)];\r\n }));","IsDeferred":false}]}