XMLHttpRequest related question

What i dont understand is why after loading the window xml is populated but the weather variable remains undefined

let weather = undefined;

let xml = new XMLHttpRequest();
xml.onreadystatechange = function(){
if(this.readystate == 4 && this.status == 200){
weather = JSON.parse(this.responseText);
xml.open(‘GET’, https://fcc-weather-api.glitch.me/api/current?lat=33&lon=33, true);


the url is a template literal so i guess when i copied the code it didnt show up??
but i guess it was a typo. thanks anyway