Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / 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

Sociology

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

13.89 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE