2. Init isn't declared with the var keyword and the function expression doesn't end with a semi-colon nor does it have final parentheses or grouping operators. Also, your else code block is the same as the if one. So if the document exists, an alert box is supposed to say "Got Document" and, if it doesn't, you also get an alert box that says "Got Document". So how are you supposed to distinguish between the two? The else alert box should obviously say "No Document" or something like that. Here is what I believe that whole section should look like:
I hope this helps.