6 D.R.Y Super lost been on this quest for a week now XD


var cost = prompt("How much is each Orange?")
var orangeCost = function(Total)
return (cost*5);



What can we do for you?


multiply 5 by your function parameter Total like this:

then call your function like this:


you dont need the prompt statement


First of all thank you very much for your help.So what you are saying is to Replace function(Total) to function(5). But isn't 5 what triggers the function? I ask because I am really trying to understand this completely. I have read and used other peoples functions that pass the assignment but I have yet to fully understand =(.


var orangeCost = function(cost) {
return cost * 5 

This is another way of doing it, but basically cost is the value of the function.

In this method you return cost and times it by 5 as they want to know the price of 5 oranges.
Then because return doesn't print anything to the console you use console.log( )
then inside you're calling the orangeCost function and giving it a value between the ()

therefor console.log(orangeCost(8)); will print to the console, 8 * 5 in this circumstance, you can change the 8 to anything you want there as it's representing orangeCost(cost) <-- whatever number you would want goes here


Thank for another solution. I just really wanted to get this assignment done by using the prompt technique. I somewhat understand now well continue to look into this until I have complete clarity.


You could do it with a prompt but it would be like this

var price = prompt("How many oranges do you want to buy?");
var orangeCost = function(price) {
return price * 5; 


Awesome I am going to give this a try and see thank you .