6/13 D.R.Y. "undefined"


#1

I tried to keep the code nice and simple, and get the right result..

But I also get "undefined".

Code:


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

console.log(orangeCost(5));


Output:


25
undefined



#2

Found it.. I'm calling console.log twice.. The last line should be:

orangeCost(5);

How do you delete topics in here?


#3

Don't this helped me :wink: thanks


#4

I'd guess by deleting the first post.