{"ScriptPreparationCode":"var obj = {\r\n a: {\r\n id: \u0022a\u0022,\r\n name: \u0022\u0412\u0430\u043D\u044F\u0022,\r\n date: \u00222024-12-01 18:00\u0022,\r\n curr: \u0022RUB\u0022,\r\n level: 12,\r\n type: \u0022B\u0022,\r\n },\r\n b: {\r\n id: \u0022b\u0022,\r\n name: \u0022\u041C\u0430\u043D\u044F\u0022,\r\n date: \u00222024-12-01 02:00\u0022,\r\n curr: \u0022KZT\u0022,\r\n level: 3,\r\n type: \u0022A\u0022,\r\n },\r\n c: {\r\n id: \u0022c\u0022,\r\n name: \u0022\u041F\u0435\u0442\u044F\u0022,\r\n date: \u00222024-12-01 12:00\u0022,\r\n curr: \u0022USD\u0022,\r\n level: 7,\r\n type: \u0022B\u0022,\r\n },\r\n d: {\r\n id: \u0022d\u0022,\r\n name: \u0022\u0412\u0438\u043A\u0430\u0022,\r\n date: \u00222024-12-01 05:00\u0022,\r\n curr: \u0022RUB\u0022,\r\n level: 9,\r\n type: \u0022A\u0022,\r\n },\r\n e: {\r\n id: \u0022e\u0022,\r\n name: \u0022\u041B\u0435\u0440\u0430\u0022,\r\n date: \u00222024-12-01 11:00\u0022,\r\n curr: \u0022RUB\u0022,\r\n level: 2,\r\n type: \u0022C\u0022,\r\n },\r\n f: {\r\n id: \u0022f\u0022,\r\n name: \u0022\u041A\u0430\u0448\u0430\u0022,\r\n date: \u00222024-12-01 15:00\u0022,\r\n curr: \u0022KZT\u0022,\r\n level: 10,\r\n type: \u0022B\u0022,\r\n },\r\n g: {\r\n id: \u0022g\u0022,\r\n name: \u0022\u041F\u0430\u0448\u0430\u0022,\r\n date: \u00222024-12-01 17:00\u0022,\r\n curr: \u0022USD\u0022,\r\n level: 1,\r\n type: \u0022A\u0022,\r\n },\r\n h: {\r\n id: \u0022h\u0022,\r\n name: \u0022\u0414\u0430\u0448\u0430\u0022,\r\n date: \u00222024-12-01 10:00\u0022,\r\n curr: \u0022RUB\u0022,\r\n level: 8,\r\n type: \u0022A\u0022,\r\n },\r\n i: {\r\n id: \u0022i\u0022,\r\n name: \u0022\u0412\u0435\u0440\u0430\u0022,\r\n date: \u00222024-12-01 00:00\u0022,\r\n curr: \u0022RUB\u0022,\r\n level: 5,\r\n type: \u0022A\u0022,\r\n },\r\n j: {\r\n id: \u0022j\u0022,\r\n name: \u0022\u0421\u0430\u0448\u0430\u0022,\r\n date: \u00222024-12-01 14:00\u0022,\r\n curr: \u0022USD\u0022,\r\n level: 11,\r\n type: \u0022C\u0022,\r\n },\r\n k: {\r\n id: \u0022k\u0022,\r\n name: \u0022\u041C\u0430\u0448\u0430\u0022,\r\n date: \u00222024-12-01 10:00\u0022,\r\n curr: \u0022KZT\u0022,\r\n level: 4,\r\n type: \u0022A\u0022,\r\n },\r\n l: {\r\n id: \u0022l\u0022,\r\n name: \u0022\u0412\u0430\u043D\u044F\u0022,\r\n date: \u00222024-12-01 15:00\u0022,\r\n curr: \u0022USD\u0022,\r\n level: 6,\r\n type: \u0022A\u0022,\r\n },\r\n};\r\n\r\nvar CURR_ORDER = {\r\n RUB: 1,\r\n USD: 2,\r\n KZT: 3,\r\n};\r\n\r\nvar TYPE_ORDER = {\r\n A: 1,\r\n B: 2,\r\n C: 3,\r\n};","TestCases":[{"Name":"for..in \u002B push","Code":"const order = [];\r\nconst map = {};\r\nfor(key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n const el = obj[key];\r\n\r\n map[el.id] = {id: el.id, curr: el.curr};\r\n order.push(el.id);\r\n }\r\n}","IsDeferred":false},{"Name":"Object.values() \u002B for \u002B push","Code":"const order = [];\r\nconst map = {};\r\nconst objArr = Object.values(obj);\r\nfor(let i = 0; i \u003C objArr.length; i\u002B\u002B) {\r\n const el = objArr[i];\r\n order.push(el.id);\r\n map[el.id] = {id: el.id, curr: el.curr};\r\n}","IsDeferred":false},{"Name":"Object.values() \u002B for","Code":"const order = [];\r\nconst map = {};\r\nconst objArr = Object.values(obj);\r\nfor(let i = 0; i \u003C objArr.length; i\u002B\u002B) {\r\n const el = objArr[i];\r\n order[i] = el.id;\r\n map[el.id] = {id: el.id, curr: el.curr};\r\n}","IsDeferred":false},{"Name":"Object.values() \u002B map()","Code":"const map = {};\r\nconst order = Object.values(obj).map((el) =\u003E {\r\n map[el.id] = {id: el.id, curr: el.curr};\r\n return el.id;\r\n});","IsDeferred":false},{"Name":"Object.values() \u002B reduce()","Code":"const {map, order} = Object.values(obj).reduce((acc, el, i) =\u003E {\r\n acc.map[el.id] = {id: el.id, curr: el.curr};\r\n acc.order[i] = el.id;\r\n return acc;\r\n}, {map: {}, order: []});","IsDeferred":false},{"Name":"Object.keys() \u002B for","Code":"const order = [];\r\nconst map = {};\r\nconst keys = Object.keys(obj);\r\nfor(let i = 0; i \u003C keys.length; i\u002B\u002B) {\r\n const el = obj[keys[i]];\r\n map[el.id] = {id: el.id, curr: el.curr};\r\n order[i] = el.id;\r\n}","IsDeferred":false}]}