D.R.Y. Spanish lesson


#1

Sorry I couldn't find the Spanish version of this toppic. The lesson is pretty much the same.

var costoNaranjas = function(costo){
    console.log(costo * 5);
};

costoNaranjas(5);

Why is the output twice? Where's that second "25" coming from??


#2

Could you translate your error message in English, please?


#3

Woops! Try again. Your function should have been equal to 25, because that is the result of buying 5 oranges at $5 each. But the result is not 25.


#4

This is what happens when the parameter is 4


#5

Yor code seems to be correct. try to refresh the browser. also check does function's name is the same as in an instruction.


#6

I did refresh it a couple of times, changed the function name (which showed a different error, that I did expect, since it wasn't the one they asked), changed the parameter name, placed the function call inside a console.log()... nothing works. I'm stuck in this course and it's all very weird.


#7

ya your code is perfect but it must be some kind of bug. I think you can just skip over it, and you should be ready to considering you know what you are doing.


#8

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