7. Return keyword - console.log problem


Can you help me to solve it? I don't understand what's the problem with codeand also got console.log error...


Hey @datarockstar84672! The reason you got a problem is that you dont need to set a variable to a function to call the function. Just delete line 6 and 8 and put


This should work, if it didnt please reply saying so!


Hey @datarockstar84672,

I don't see a problem... Did you try refreshing first? :smiley:


Tried :wink: Even closed and reopened website and nothing. In the worst case i can always restart my computer :smiley:


I tried the exact same thing as you did... and it works. :confused:

var timesTwo = function(number) {
return number * 2;

// Call timesTwo here!
var newNumber = timesTwo(5);

Does this code not work? Try it out. :confused:


heehee, funny that, we I hear that said a lot, "have you tried turning it off and on again"... good 'ole IT Crowd :smile:

If you have NOT resolved this, @datarockstar84672, would you mind copying and pasting your code as is here so I could just try it myself please?

Also have you at least tried another browser? Though it find it unlikely, it is possible @ragezapper is on to something here.


Yeah might be because of the browser. :smile:


Wait did you try my method?


Apparently changing browser solved the problem :smiley: Computer computer never changes :wink:


Nice. Now I suggest using that browser that you just used in Codecademy. :smiley:

You don't want to deal with something like that again.


It's my 5th course on codecademy and has never gave me this kind of problems before.




Same problem here when using Safari. Works fine with Google Chrome, though.


I copied your code and submitted and it passed but the funny thing is it printed "NaN". I was under the impression it would be integers it would print out.


It should print out integers what was your input? The most likely explanation for NaN would be that the input was not an integer as "Not a number" *2 yields NaN.



Sry for the late response no idea why I didn't got a notification on this one. Yes it is what I expected:
here you call the function:

var nuevoNumero = porDos()

as you leave the () empty you pass no value to the function meaning that the parameter numero inside of the function stays undefined and undefined*number equals Not a Number (NaN). Just pass any number instead idk here again 42 could be the answer (but as well any other number) :slightly_smiling:

PS: the reason for passing is that the function is actually correct you used the right variables and all that stuff it's just that you picked a strange input (no input when an input is expected).


Same issue with my code as well.


this didnt help me. :frowning:


I don't understand what "return" does can you explain it to me?