bloominstituteoftechnology/Precourse

The last exercise of the fourth lesson (JSIII) does not mention that the 'storeItem' object needs to be returned

ThomasTerebesi opened this issue · 2 comments

Referring to this exercise in the homework.js of the fourth lesson (JSIII):

function addCalculateDiscountPriceMethod(storeItem) {
  // add a method to the storeItem object called 'calculateDiscountPrice'
  // this method should multiply the storeItem's 'price' and 'discountPercentage' to get the discount
  // the method then subtracts the discount from the price and returns the discounted price
  // example: 
  // price -> 20
  // discountPercentage -> .2
  // discountPrice = 20 - (20 * .2)

  ... solution here ...

  return storeItem;
}

It was not clear to me that the storeItem object needed to be returned.

As an aside to this, the test should probably be updated to not need the return of store item... As it would update the storeItem with the new method. https://repl.it/@lefrenk/BlaringDeeppinkMegalosaurus

You got this one Tdog?