TypeError: console.log is not a function


#1


I'm doing Return exercise but I have an error and I don't understand why. I wrote the code below and I get this message:
TypeError: console.log is not a function

I know console.log is not a function, I just want to print newNumber. What Am I doing wrong?

Thank you in advance


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

var newNumber = timesTwo(8);
console.log(newNumber);


#2

Presumably you assigned something else to console.log, something that wasn't a function

console.log = 5
console.log()  // obviously not referring to a function any more

restart your environment. ie. refresh the page


#3

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