The code don't runs, please help


#1

Hi friends. In the 'Introducción a las funciones en JS' training course, is not possible to pass from chaper 6 'No Te Repitas' to the chapter seven. although the code runs in a normal web browser, at the console training enviroment don't run. Please any coments? Thanks a lot


https://www.codecademy.com/es/courses/javascript-beginner-es-WIk0w/1/1?curriculum_id=50d3cc1bca413c863600126d


The error mesage that i've is: ' ¡Uy! Probá otra vez. Tu función debería haber sido igual a 25, porque es el resultado de comprar 5 naranjas a 5 dólares cada una. Pero el resultado no es 25 '.


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


#2

According to the instructions, you don't have to assign the product to a variable. So, remove the variable and just do console.log (5 * precio);


#3

Thanks gvm. But still doesn't works.
This's my new code:

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

... and the error is the same.
I think, is possible an web app error (training page), because I have a msg that says: 'you've completed this lesson!, and still I can't go to chapter number 7, please check the attached screenshot.
Thanks for your advise.


#4

I found the solution at:

But I don't understand why 'console.log' don't works.


#5

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