Created
August 22, 2011 17:03
-
-
Save boxxxie/1162909 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calc_item_cost = function (item) { | |
'use strict'; | |
var price = item.price; | |
if (item.modifiers) { | |
var modifiersCost = item.modifiers.reduce(function (totalModifierCost, modifier, index, array) { | |
return totalModifierCost + calc_modifier_cost(modifier); | |
}, 0); | |
return price + modifiersCost; | |
} | |
return price; | |
}; | |
//---------js lint error | |
/* | |
Error: | |
Problem at line 5 character 9: Combine this with the previous 'var' statement. | |
var modifiersCost = item.modifiers.reduce(function (totalModifierCost, modif... | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment