This is the code:
var name = window.prompt("What is your name").toLowerCase;
console.log(name);
It returns undefined
, which seems confusing. Shouldn't it log to the console the string I type in?
This is the code:
var name = window.prompt("What is your name").toLowerCase;
console.log(name);
It returns undefined
, which seems confusing. Shouldn't it log to the console the string I type in?
You are missing ()
in toLowerCase
call
var name = window.prompt("What is your name").toLowerCase();
console.log(name);