Don´t repeat yourself. Could this code work?


var price = prompt("How much do the oranges cost");

var orangeCost(price) {

var value = price*5;




This will not work because you didn't properly create a function called orangeCost.


Right here ^. You created a function without using the word function. To create a function then you need to say:

var example = function(parameterName) {
content of the function

Also remember to call the function and pass in any parameter that you mad like this:

example(replace parameterName here);


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