6. dry


var orangeCost = function(price)
{var value = oranges*5



when calling function:


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


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)


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


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


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