It keeps showing me an error wher there is none


#1


I have problem with Function and Return, excersice Don't repeat yourself at JavaScript tutorials.


I think that the function i wrote is correct, but it keeps telling me that there is a mistake in my code.


<img src="//codecademy-discourse.s3.amazonaws.com/original/5X/8/5/8/d/858d05ec6168f73039d70731d9d20e2c67a304ad.jpg" width="690" height="388">
var orangeCost = function(price){
    var cost = price * 5;
    console.log("Cost is: " + cost);
};

orangeCost(5);


#2

This is sort of a funny problem actually. Don't worry your code is completely fine! But what about the error? The lesson has a problem with your console.log. See when you called your function and console.log it conflicted with what the lesson wanted originally so it raised an error. Get rid of your console.log and you will pass the lesson. Not exactly sure why the trouble but I believe it is because the lesson wanted just one line on the console of cost is: 25 not two and it wanted you to accomplish that through calling your function not a console.log.


#3

Thank you for the answer!
When i remove the console.log() the code works fine.


#4

No problem! Glad to have been of service.


#5

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