question archive JavaScript foundations: Object shorthand & spread Instructions To complete this Practice problem, you will update the existing functions in src/solution

JavaScript foundations: Object shorthand & spread Instructions To complete this Practice problem, you will update the existing functions in src/solution

Subject:Computer SciencePrice:19.89 Bought3

JavaScript foundations: Object shorthand & spread

Instructions

To complete this Practice problem, you will update the existing functions in src/solution.js to use new syntax you have learned. Use object shorthand and the spread operator whenever possible.

/*

Modify each function below to continue working with the suggested syntax.

When a function's parameters reference `product`, it is referring to an object. Each object has the following shape:

{

name: "Washed Black Denim Overalls",

priceInCents: 12000,

availableSizes: [ 28, 30, 32, 36 ]

}

*/

// `salesTax` is a decimal number, like 0.065

function createSalesProduct(product, salesTax) {

return {

name: product.name,

availableSizes: product.availableSizes,

salesTax: 0.065,

priceInCents: product.priceInCents * (1 + salesTax),

};

}

function joinSizes(productA, productB) {

const result = ...productA.availableSizes, ...productB.availableSizes;

}

return result;

}

Option 1

Low Cost Option
Download this past answer in few clicks

19.89 USD

PURCHASE SOLUTION

Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

rated 5 stars

Purchased 3 times

Completion Status 100%

Related Questions