Skip to content

Commit

Permalink
complete homework SunJieMing#3 Questions on SunJieMing#3 & SunJieMing#14
Browse files Browse the repository at this point in the history
. See notes at top.
  • Loading branch information
StevieIsmagic committed Jul 4, 2017
1 parent 8439461 commit fa20272
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exercises.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
//QUESTIONS: #3 invokeMethod, #14 addCalculateDiscountPriceMethod(storeItem) using storeItem vs 'this' ?
//QUESTION clarification on using object[property] vs object['property']
//QUESTION clarification on using object[property] vs object['property']

//Do not change any of the function names

Expand Down Expand Up @@ -165,6 +165,9 @@ function addCalculateDiscountPriceMethod(storeItem) {
//price -> 20
//discountPercentage -> .2
//discountPrice = 20 - (20 * .2)

// LOOK INTO UNDERSTANDING THIS PROBLEM A BIT MORE IN DEPTH!!

storeItem.calculateDiscountPrice = function(){
var discount = this.price * this.discountPercentage;
var discountPrice = this.price - discount;
Expand Down

0 comments on commit fa20272

Please sign in to comment.