{"ScriptPreparationCode":"function getUniqueProps0(objA = {}, objB = {}) {\r\n const diff = {};\r\n for (const key in objB) {\r\n if (!(key in objA)) {\r\n diff[key] = objB[key]\r\n }\r\n }\r\n\r\n return diff;\r\n}\r\n\r\nfunction getUniqueProps1(objA = {}, objB = {}) {\r\n return Object.keys(objB).reduce((diff, key) =\u003E {\r\n if (!(key in objA)) {\r\n diff[key] = objB[key];\r\n }\r\n\r\n return diff;\r\n }, {});\r\n}\r\n\r\nfunction getUniqueProps2(objA = {}, objB = {}) {\r\n const keySet = new Set(Object.keys(objA));\r\n\r\n return Object.keys(objB).reduce((diff, key) =\u003E {\r\n if (!keySet.has(key)) {\r\n diff[key] = objB[key];\r\n }\r\n\r\n return diff;\r\n }, {});\r\n}\r\n\r\nfunction getUniqueProps3(objA = {}, objB = {}) {\r\n const keySet = new Set(Object.keys(objA));\r\n\r\n const diff = {};\r\n\r\n for (const key in objB) {\r\n if (!keySet.has(key)) {\r\n diff[key] = objB[key];\r\n }\r\n }\r\n\r\n return diff;\r\n}","TestCases":[{"Name":"unique - for...in","Code":"const metaProps = {\r\n \u0027a\u0027: 1,\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1\r\n};\r\n\r\nconst props = {\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1,\r\n \u0027d\u0027: 1\r\n};\r\n\r\ngetUniqueProps0(metaProps, props);","IsDeferred":false},{"Name":"unique - keys.reduce","Code":"const metaProps = {\r\n \u0027a\u0027: 1,\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1\r\n};\r\n\r\nconst props = {\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1,\r\n \u0027d\u0027: 1\r\n};\r\n\r\ngetUniqueProps1(metaProps, props);","IsDeferred":false},{"Name":"unique - set \u002B reduce","Code":"const metaProps = {\r\n \u0027a\u0027: 1,\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1\r\n};\r\n\r\nconst props = {\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1,\r\n \u0027d\u0027: 1\r\n};\r\n\r\ngetUniqueProps2(metaProps, props);","IsDeferred":false},{"Name":"unique - set \u002B for...in","Code":"const metaProps = {\r\n \u0027a\u0027: 1,\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1\r\n};\r\n\r\nconst props = {\r\n \u0027b\u0027: 1,\r\n \u0027c\u0027: 1,\r\n \u0027d\u0027: 1\r\n};\r\n\r\ngetUniqueProps3(metaProps, props);","IsDeferred":false}]}