Created
February 18, 2012 02:12
-
-
Save ashryanbeats/1856923 to your computer and use it in GitHub Desktop.
Conditionals in Javascript Project 2.5
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 calculateTotalCosts = function(salary,numWorkers,city){ | |
var fixedCosts = 5000; | |
var variableCosts = salary*numWorkers; | |
if(city === "NYC"){ | |
return fixedCosts+variableCosts+30000; | |
} else { | |
return fixedCosts+variableCosts; | |
} | |
} | |
calculateTotalCosts(30000,7,"NYC"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment