Merge specific prop of objects into one using es6?
问题 This is by far the most common question asked in SO, however, all in all, the questions asked refers to merging two whole objects. In my case, it's quite different. Suppose I'm given: const P1 = { "name" : "Person1", "profession" : "Student", "gender" : "Male", "type" : "Patient", } const E1 = { "age" : "30", "dob" : "20/12/1970", "address" : "122 Harrow Street", "contactNumber" : "07473033312", } and I want to merge these two to give me the following: const Result = { "name" : "Person1",