Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Помогите разобраться (https://javascript.ru/forum/misc/54251-pomogite-razobratsya.html)

PaulBug 10.03.2015 21:01

Помогите разобраться
 
Здравствуйте ! Недавно начал проходить курс с javascript на http://www.codecademy.com/ и застрял на задании. Вот текст :

You are a creature of habit. Every week you buy 5 oranges.
But orange prices keep changing!

- You want to declare a function that calculates the cost of buying 5 oranges.

- You then want to calculate the cost of the 5 all together.

- Write a function that does this called orangeCost().

- It should take a parameter that is the cost of an orange, and multiply it by 5.

- It should log the result of the multiplication to the console.

- Call the function where oranges each cost 5 dollars.

И вроде ничего сложного, более или менее понятно. Но что-бы я не писал выскакивает error. Помогите с этим. Спасибо !

Blondinka 12.03.2015 20:21

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


Часовой пояс GMT +3, время: 05:51.