QuickFix: CodeAcademy - Functions in JavaScript

No Comments

I recently tried out CodeAcademys Codeyear. It's designed to teach people programming with online exercises in JavaScript. I like the idea and what I have seen so far. Only one slight problem:

In the course "Functions in Javascript" Lesson 2 Exercise 3 you are supposed to just hit run to complete the exercise and go on to the next. That didn't work for me since the Interpreter in the exercise doesn't output a NaN like this interpreter.

Here is a quick fix to complete the exercise none the less. You have to change

// But if it is called with a string, it receives NaN
(cube("test");

to this:

// But if it is called with a string, it receives NaN
console.log(cube("test"));