{"ScriptPreparationCode":"//------------------ SETUP\r\nfunction memoizeWithoutClosure(fn) {\r\n const memoizedFunction = () =\u003E {\r\n if (memoizedFunction.cache === undefined) {\r\n memoizedFunction.cache = fn();\r\n }\r\n return memoizedFunction.cache;\r\n };\r\n\r\n return memoizedFunction;\r\n}\r\n\r\nfunction memoize(fn) {\r\n let cachedResult;\r\n\r\n return () =\u003E {\r\n if (cachedResult === undefined) {\r\n cachedResult = fn();\r\n }\r\n return cachedResult;\r\n };\r\n} \r\n\r\nvar funcs = [...Array(5000).keys()].map(_ =\u003E (() =\u003E \u0027ashkjsaskhkajhdkajhdk\u0027));\r\n\r\n\r\n\r\n//----------- MEMOIZE WIthour Closure\r\nconst memoizedFuncs = funcs.map(fn =\u003E memoizeWithoutClosure(fn));\r\nmemoizedFuncs.forEach(fn =\u003E fn());\r\nmemoizedFuncs.forEach(fn =\u003E fn());","TestCases":[{"Name":"Memoize","Code":"//------------ MEMOIZE\r\nconst memoizedFuncs = funcs.map(fn =\u003E memoize(fn));\r\nmemoizedFuncs.forEach(fn =\u003E fn());\r\nmemoizedFuncs.forEach(fn =\u003E fn());","IsDeferred":false},{"Name":"Memoize without closure","Code":"//----------- MEMOIZE without Closure\r\nconst memoizedFuncs = funcs.map(fn =\u003E memoizeWithoutClosure(fn));\r\nmemoizedFuncs.forEach(fn =\u003E fn());\r\nmemoizedFuncs.forEach(fn =\u003E fn());","IsDeferred":false}]}