{"ScriptPreparationCode":null,"TestCases":[{"Name":"Destruct with map","Code":"const target = {\r\n \u0022fluid\u0022: true,\r\n \u0022marginLess\u0022: true,\r\n \u0022aria-label\u0022: \u0022date\u0022,\r\n \u0022value\u0022: \u0022\u0022\r\n}\r\n\r\nfunction destruct(\r\n target,\r\n keys\r\n) {\r\n const destructedEntries = new Map();\r\n const originalEntries = new Map();\r\n\r\n Object.entries(target).forEach(([index, value]) =\u003E {\r\n if (keys.includes(index)) {\r\n destructedEntries.set(index, value);\r\n return;\r\n }\r\n originalEntries.set(index, value);\r\n });\r\n\r\n return [\r\n Object.fromEntries(destructedEntries),\r\n Object.fromEntries(originalEntries),\r\n ];\r\n}\r\n\r\ndestruct(target, [\u0022marginLess\u0022, \u0022value\u0022])","IsDeferred":false},{"Name":"Destruct with object","Code":"const target = {\r\n \u0022fluid\u0022: true,\r\n \u0022marginLess\u0022: true,\r\n \u0022aria-label\u0022: \u0022date\u0022,\r\n \u0022value\u0022: \u0022\u0022\r\n}\r\n\r\nfunction destruct(\r\n target,\r\n keys\r\n) {\r\n const destructedEntries = {};\r\n const originalEntries = {};\r\n\r\n Object.entries(target).forEach(([index, value]) =\u003E {\r\n if (keys.includes(index)) {\r\n destructedEntries[index] = value;\r\n return;\r\n }\r\n originalEntries[index] = value;\r\n });\r\n\r\n return [destructedEntries, originalEntries];\r\n}\r\n\r\ndestruct(target, [\u0022marginLess\u0022, \u0022value\u0022])","IsDeferred":false}]}