Introduction to Functions in JS bug?


#1
"Oops, try again.
It looks like you didn't print out the value of newNumber"

... it printed out the value in the console what's wrong? I didn't even type this code I just filled in the values.

// 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");
console.log(newNumber);


#2

Hi you should remove the " " around the number 8


#3

Thanks... why did that fix it? With the " " the console still multiplied it.


#4

Beause with the " " around your number become a string.