var orangecost = function (price) {var cost = price * 5;console.log(cost);}orangecost(5);
You want to declare a function that calculates the cost of buying 5 oranges. You then want to calculate the cost of the 5 all together. Write a function that does this called orangeCost(). It should take a parameter that is the cost of an orange, and multiply it by 5. It should log the result of the multiplication to the console. Call the function where oranges each cost 5 dollars.
What is the one bit of input that changes each time? It would be the price. So give your parameter the name price. And when you call your function, put in a number for the price to see how much 5 oranges cost!