{"ScriptPreparationCode":"var a = {\r\n a: {\r\n e: 25,\r\n x: 3,\r\n y: {\r\n d: 2,\r\n e: 2,\r\n f: {\r\n g: 4\r\n },\r\n z: 8\r\n },\r\n f: {\r\n f: {\r\n d: {\r\n b: {\r\n a: 15,\r\n b: 34\r\n }\r\n }\r\n }\r\n }\r\n }\r\n};\r\n","TestCases":[{"Name":"reduce ","Code":"const getSortedReduce2 = (obj) =\u003E {\r\n return Object.entries(obj).reduce((acc, [key, value]) =\u003E {\r\n if (isNaN(value)) {\r\n acc = acc.concat(getSortedReduce2(obj[key]));\r\n } else {\r\n if (!acc.includes(value)) {\r\n acc = acc.concat(value);\r\n }\r\n }\r\n return acc.sort((a, b) =\u003E a - b);\r\n }, []);\r\n};\r\n\r\ngetSortedReduce2(a);","IsDeferred":false},{"Name":"foreach","Code":"const e = [];\r\nconst getSortedNumber = (obj) =\u003E {\r\n Object.entries(obj).forEach(([key, value]) =\u003E {\r\n if (!isNaN(value)) {\r\n if (!e.includes(value)) {\r\n e.push(value);\r\n }\r\n } else {\r\n getSortedNumber(obj[key]);\r\n }\r\n });\r\n};\r\ngetSortedNumber(a);\r\ne.sort((a, b) =\u003E a - b);\r\n\r\n","IsDeferred":false}]}