{"ScriptPreparationCode":null,"TestCases":[{"Name":"native approach with reduce","Code":"var fruits= {\r\n \u0027apple\u0027: { \u0027name\u0027: \u0027apple\u0027, \u0027number\u0027: 5},\r\n \u0027orange\u0027: { \u0027name\u0027: \u0027orange\u0027, \u0027number\u0027: 10 }\r\n};\r\n\r\nconsole.log(Object.entries(fruits)\r\n .reduce((a, [key, { number }]) =\u003E {\r\n a[key] = number;\r\n return a;\r\n }, {}\r\n));","IsDeferred":false},{"Name":"native approach fromEntries","Code":"var fruits= {\r\n \u0027apple\u0027: { \u0027name\u0027: \u0027apple\u0027, \u0027number\u0027: 5},\r\n \u0027orange\u0027: { \u0027name\u0027: \u0027orange\u0027, \u0027number\u0027: 10 }\r\n};\r\n\r\nconsole.log(Object.fromEntries(\r\n Object.entries(fruits).map(([key, { number }]) =\u003E [key, number])\r\n));","IsDeferred":false},{"Name":"lodash mapValues","Code":"var fruits= {\r\n \u0027apple\u0027: { \u0027name\u0027: \u0027apple\u0027, \u0027number\u0027: 5},\r\n \u0027orange\u0027: { \u0027name\u0027: \u0027orange\u0027, \u0027number\u0027: 10 }\r\n};\r\n\r\nconsole.log(_.mapValues(fruits, \u0027number\u0027));","IsDeferred":false}]}