Declaring a variable without assigning a value versus declaring a variable and assigning it to nothing

Is there there a difference between these two variable declarations?

var answer;

var answer = " ";

I look forward to a response from anyone. Thank you.

The first declaration gives answer a value of undefined.

The second declaration (initialization) assigns answer a space character for a value.

1 Like

The first one is a null initial value. (correction: undefined)
The second one is a string, albeit empty string.

Ok. I get it. Thanks.

The question looks trivial. I am a newbie in javascript - still coming up. Thanks for the response though. This is clear now.