Don't Repeat Yourself D.R.Y. - why is it logging the function name?


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/1?curriculum_id=506324b3a7dffd00020bf661


No error messages, I passed this one with this code!
But it returns:
[Function: orangeCost]
rather than 25!
I've been looking at this for a while and I can't work out why, please can you help? :slight_smile:


var orangeCost = function(number) {
    var val = number * 5
}
orangeCost(5)
console.log(orangeCost)


#2

i think you need to your function(number ) to function(price) see if that helps:D


#3

So try putting the function and its argument inside the parentheses of the console.log statement instead


#4

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