7 kyu
Combine objects
957 of 9,436matthewglover
Description:
Your task is to write a function that takes two or more objects and returns a new object which combines all the input objects.
All input object properties will have only numeric values. Objects are combined together so that the values of matching keys are added together.
An example:
objA = { 'a': 10, 'b': 20, 'c': 30 }
objB = { 'a': 3, 'c': 6, 'd': 3 }
combine(objA, objB) # Returns { a: 13, b: 20, c: 36, d: 3 }
The combine function should be a good citizen, so should not mutate the input objects.
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Feb 12, 2016 |
Published | Feb 12, 2016 |
Warriors Trained | 13351 |
Total Skips | 140 |
Total Code Submissions | 24728 |
Total Times Completed | 9436 |
JavaScript Completions | 8361 |
Python Completions | 957 |
Ruby Completions | 191 |
Total Stars | 154 |
% of votes with a positive feedback rating | 88% of 630 |
Total "Very Satisfied" Votes | 517 |
Total "Somewhat Satisfied" Votes | 78 |
Total "Not Satisfied" Votes | 35 |