JavaScript Coding Practice |Concatenate Objects with Spread Operator | AK@Tech |



JavaScript Coding Practice |Concatenate Objects with Spread Operator | AK@Tech |

JavaScript Coding Practice |Concatenate Objects with Spread Operator | AK@Tech |

Given three objects model, engine, and carDetails.
Write a JS program to merge the model, and engine objects into the carDetails object using the spread operator.
Input:
The first line of input contains an object.
The second line of input contains an object.
Output:
The output should be a single line containing the given console statement.
Constraints:
Given objects should contain the same keys as in sample inputs. Keys of the objects should be given in quotes.
Sample Input 1: Sample Output 1
{‘model’:’Amaze’} Amaze is powered with 4000cc engine.
{‘engineCapacity’:4000}
Sample Input 2: Sample Output 2
{‘model’:’i10’} i10 is powered with 3000cc engine.
{‘engineCapacity’:3000}