Welcome to the Treehouse Community
Looking to learn something new?
what is the point of var html = '';
var html = ''
Alexander Gyger14,237 Points
var html = '';
you define that (html) is a string(text)-variable. ('') contains a specific, but empty text. After this definition you can add other strings (+ 'other string') to it later.
If you don't define this (html) as a string-variable, just only the variable:
it will give you an ugly "undefined"-Error in the output, since the script will try to add a string to a variable which isn't defined.
It's declaring an empty string variable to be used later. You can write it with either single quotes or double quotes.
var html = ''; var html = "";
and then later you might set it to something like
html = 'string';
html = "string";