#6 d.r.y


#1

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

This is what I came up with for this section. I passed, but I am wondering if this was the right way to do this?


#2

Well, yes that is correct. However there is a much more simpler way of declaring the function. You can declare a function like this:

function returnProduct(num1, num2) {
console.log(num1* num2);
}
returnProduct(4, 4);


#3

I've been struggling with this lesson myself, but the method you presented looks much more complicated to me. Functions have been a bit of a challenge for myself, so I am open to new methods as long as they are simple enough for a complete beginner.