Don´t repeat yourself. Could this code work?


#1

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

var orangeCost(price) {

var value = price*5;
console.log(value);

}

`


#2

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


#3

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);


#4

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