Need the following function for one of my programs. The function is easy to make but tedious so I'd like to pay someone to do it. It must be written in javascript. I've provided the docstring and function header below as well as an example input for `upgrades`. Upgrade costs can be found https://wiki.torn.com/wiki/Company#Upgrades
/**
* Return the startup cost + cost of upgrades for a company of the given with the given upgrades as a percentage of the startup cost
* @param upgrades company->company_detailed->upgrades
* @param company_type the company's type
* @return {number} cost of company
*/
function calcCompCost(upgrades, company_type){
}
"upgrades": {
"company_size": 10,
"staffroom_size": "Large staff room",
"storage_size": "No storage room",
"storage_space": 0,
}
/**
* Return the startup cost + cost of upgrades for a company of the given with the given upgrades as a percentage of the startup cost
* @param upgrades company->company_detailed->upgrades
* @param company_type the company's type
* @return {number} cost of company
*/
function calcCompCost(upgrades, company_type){
}
"upgrades": {
"company_size": 10,
"staffroom_size": "Large staff room",
"storage_size": "No storage room",
"storage_space": 0,
}