{"ScriptPreparationCode":null,"TestCases":[{"Name":"off Arrays with Reducer","Code":"const offArrays = obj =\u003E Object.keys(obj).reduce((off, key) =\u003E (obj[key] instanceof Array) ? off : (obj[key] instanceof Object) ? { ...off, [key]: offArrays(obj[key]) } : { ...off, [key]: obj[key] }, {})\r\n\r\nlet objeto = {\r\n\ta: 1,\r\n b: [2,3],\r\n c: 4,\r\n d: {\r\n \te: 5,\r\n f: {\r\n \tg: 6,\r\n h: [7, 8]\r\n },\r\n i: [9, 10],\r\n j: 11\r\n },\r\n k: {\r\n \tl: [12,13]\r\n },\r\n m: 14\r\n}\r\nconsole.log(offArrays(objeto))","IsDeferred":false},{"Name":"off arrays with Linear","Code":"const withoutArrays = obj =\u003E {\r\n\tif (!(obj instanceof Object)) return obj\r\n\tif (!(obj instanceof Array)) {\r\n let result\r\n for (const prop in obj) {\r\n \tconst out = withoutArrays(obj[prop])\r\n if (out !== undefined) result = { ...result, [prop]: out }\r\n }\r\n return result\r\n }\r\n return undefined\r\n}\r\n\r\nlet objeto = {\r\n\ta: 1,\r\n b: [2,3],\r\n c: 4,\r\n d: {\r\n \te: 5,\r\n f: {\r\n \tg: 6,\r\n h: [7, 8]\r\n },\r\n i: [9, 10],\r\n j: 11\r\n },\r\n k: {\r\n \tl: [12,13]\r\n },\r\n m: 14\r\n}\r\nconsole.log(withoutArrays(objeto))","IsDeferred":false}]}