{"ScriptPreparationCode":"var logLevels = [\u0027debug\u0027, \u0027log\u0027, \u0027info\u0027, \u0027warn\u0027, \u0027error\u0027]\r\n \r\nfunction makeLoggerA(label, parent) {\r\n return Object.fromEntries(\r\n logLevels.map(level =\u003E [\r\n level,\r\n (...args) =\u003E {\r\n parent[level](label, ...args)\r\n },\r\n ]),\r\n )\r\n}\r\n\r\nfunction makeLoggerB(label, parent) {\r\n let ret = {}\r\n for (let level of logLevels) {\r\n ret[level] = parent[level].bind(parent, label)\r\n }\r\n return ret\r\n}\r\n\r\nvar loggerA = makeLoggerA(\u0027example\u0027, console)\r\n\r\nvar loggerB = makeLoggerB(\u0027example\u0027, console)\r\n","TestCases":[{"Name":"fromentries/map/closure","Code":"loggerA.log(\u0022Hello\u0022);","IsDeferred":false},{"Name":"bind","Code":"loggerB.log(\u0022Hello\u0022);","IsDeferred":false}]}