How do I log the variable totalCost to the console? I am getting an error when trying to run this code
Tried using console.log(totalCost);
function monitorCount(rows, columns) {
return rows * columns;
}
function costOfMonitors(rows, columns){
return monitorCount(rows, columns) * 200;
const totalCost = costOfMonitors(5, 4);
}
console.log(totalCost);
const totalCostinside thecostOfMonitorsfunction?costOfMonitorsfunction before you settotalCosttotalCostis scoped, so the OP is going to get antotalCost is not defined error anyway