How to calculate functions


#1


var orangeCost = function (cost)
{
    var totalCost = function (total);
    console.log(cost)(total);
};
orangeCost("cost");
totalcost("total");


#2

What should the function totalCost do? Right now this is not a correct definition of a function:
var totalCost = function (total);

And also this is invalid JavaScript syntax

console.log(cost)(total);


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.