-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq45.js
More file actions
10 lines (7 loc) · 660 Bytes
/
Copy pathq45.js
File metadata and controls
10 lines (7 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
// Cars: Write a function that stores information about a car in a Object. The function should always receive a manufacturer and a model name. It should then accept an arbitrary number of keyword arguments. Call the function with the required information and two other name-value pairs, such as a color or an optional feature. Print the Object that’s returned to make sure all the information was stored correctly.
function createCar(manufacturer, model, options) {
const car = { manufacturer, model, ...options };
return car;
}
const myCar = createCar('Toyota', 'Camry', { color: 'silver', sunroof: true });
console.log(myCar);