0

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?

Talha Awan
  • 4,573
  • 4
  • 25
  • 40
Nicolae Stroncea
  • 587
  • 2
  • 6
  • 17

1 Answers1

0

You are missing () in toLowerCase call

var name = window.prompt("What is your name").toLowerCase();
console.log(name);
Jarek Kulikowski
  • 1,399
  • 8
  • 9