SHOW:
|
|
- or go back to the newest paste.
| 1 | function calculateTotalCosts(salary, numWorkers, city) {
| |
| 2 | - | var total = 5000+salary*numWorkers; |
| 2 | + | return 5000+salary*numWorkers+((city=='NYC') ? 30000 : ((city=='BEJ') ? 25000 : 1000)); |
| 3 | - | switch(city) {
|
| 3 | + | |
| 4 | - | case "NYC": |
| 4 | + | console.log(calculateTotalCosts(40000, 3, "DLH")); |