This forum is now read-only. Please use our new forums at discuss.codecademy.com.

How to use APIs with JavaScript Forum

View Course » View Exercise

699 points
5b8b8f1cf2566d14e1c57b387b4ca834?s=140&d=retro
Submitted by
Jndvdcn
about 4 years ago

var syntax

Here's line 7 :
xmlDocument = xhr.responseXML;

xmlDocument wasn't defined in previous lines of code, so I would have imagined the syntax to be something like :
var xmlDocument = xhr.responseXML;

Why does this piece of code work without the "var xmlDocument" syntax ?


0 votes

permalink

Can you show us all of your code?
It's possible that Codecademy purposefully corrected the error...

629 points
517ee30761d2b38b6d000157_108858531
Submitted by
Tony Brar
almost 4 years ago