7. Return Keywords


What am I doing wrong?

// Parameter is a number, and we do math with that parameter
var timesTwo = function(number) {
    return number * 2;

// Call timesTwo here!
var newNumber = timesTwo(8){


Heres how you would do it:

var newNumber = timesTwo(8); 
/*We pass 8 into timesTwo which multiplies it by 2 and returns it.  We store the returned code in newNumber.*/
//We print the new number.


Thank you Sgt. JavaScript is currently kicking my tail but ill get the hang of it!


Yes sir. Keep practicing, paying attention to the fine details in the lesson, and reading your error messages! :grinning:


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