6. dry


#1

var orangeCost = function(price)
{var value = oranges*5
console.log(orangeCost)};
orangeCost(5);

ANY HELP!!!!


#2

when calling function:

orangeCost(5);

the argument provided at the function call (in this case: 5) will be hold by the function parameter (price), this (price) is what you need multiply by 5 and print to the console


#3

I honestly dont understand why we can't write something like this that is simple and works
var orangeCost = prompt("Please enter single orange cost")
console.log(orangeCost * 5)


#4

because you need to learn functions? We can't introduce the most complicated function at the start, that would confusing, wouldn't it?


#5

2 posts were split to a new topic: 6. dry


#6

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