Spread operator

Report a typo

You have two objects:

const shoppingList = { milk: 1, bread: 2, sugar: 1};
const addingList = { apple: 4, lemon: 2 };

Copy these two objects into another one using spread operator in order to get this:

const fullList = { milk: 1, bread: 2, sugar: 1, apple: 4, lemon: 2 }

Tip: Do not console log the output. It's taken care of internally

Sample Input 1:

Sample Output 1:

{ milk: 1, bread: 2, sugar: 1, apple: 4, lemon: 2 }
Write a program in JavaScript
const shoppingList = { milk: 1, bread: 2, sugar: 1};
const addingList = { apple: 4, lemon: 2 };

const fullList = //write your code here
___

Create a free account to access the full topic