{"ScriptPreparationCode":null,"TestCases":[{"Name":"merge lodash","Code":"const arr1 = [{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d8\u0022,\u0022bank\u0022 : \u0022575b052ca6f66a5732749ecc\u0022,\u0022country\u0022 : \u0022575b0523a6f66a5732749ecb\u0022},{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d6\u0022,\u0022bank\u0022 : \u0022575b052ca6f66a5732749ecc\u0022,\u0022country\u0022 : \u0022575b0523a6f66a5732749ecb\u0022}];\r\nconst arr2 = [{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d6\u0022,\u0022name\u0022 : \u0027xxxxxx\u0027,\u0022age\u0022 : 25},{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d8\u0022,\u0022name\u0022 : \u0027yyyyyyyyyy\u0027,\u0022age\u0022 : 26}];\r\n\r\nconst merged = _(arr1) // start sequence\r\n .keyBy(\u0027member\u0027) // create a dictionary of the 1st array\r\n .merge(_.keyBy(arr2, \u0027member\u0027)) // create a dictionary of the 2nd array, and merge it to the 1st\r\n .values();","IsDeferred":false},{"Name":"merge find","Code":"const arr1 = [{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d8\u0022,\u0022bank\u0022 : \u0022575b052ca6f66a5732749ecc\u0022,\u0022country\u0022 : \u0022575b0523a6f66a5732749ecb\u0022},{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d6\u0022,\u0022bank\u0022 : \u0022575b052ca6f66a5732749ecc\u0022,\u0022country\u0022 : \u0022575b0523a6f66a5732749ecb\u0022}];\r\nconst arr2 = [{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d6\u0022,\u0022name\u0022 : \u0027xxxxxx\u0027,\u0022age\u0022 : 25},{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d8\u0022,\u0022name\u0022 : \u0027yyyyyyyyyy\u0027,\u0022age\u0022 : 26}];\r\nconst merged = arr1.filter( element1 =\u003E ! arr2.find( element2 =\u003E element1[\u0022member\u0022] === element2[\u0022member\u0022]) ).concat(arr2);","IsDeferred":false},{"Name":"merge some","Code":"const arr1 = [{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d8\u0022,\u0022bank\u0022 : \u0022575b052ca6f66a5732749ecc\u0022,\u0022country\u0022 : \u0022575b0523a6f66a5732749ecb\u0022},{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d6\u0022,\u0022bank\u0022 : \u0022575b052ca6f66a5732749ecc\u0022,\u0022country\u0022 : \u0022575b0523a6f66a5732749ecb\u0022}];\r\nconst arr2 = [{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d6\u0022,\u0022name\u0022 : \u0027xxxxxx\u0027,\u0022age\u0022 : 25},{\u0022member\u0022 : \u002257989cbe54cf5d2ce83ff9d8\u0022,\u0022name\u0022 : \u0027yyyyyyyyyy\u0027,\u0022age\u0022 : 26}];\r\nconst merged = arr1.filter( element1 =\u003E ! arr2.find( element2 =\u003E element1[\u0022member\u0022] === element2[\u0022member\u0022]) ).concat(arr2);","IsDeferred":false}]}