I have an array that I want to using each value from it in my GET
request. Something like this :
function something(){
let test = ['something', 'other', 'test'];
let httpRequest;
function makeRequest(){
httpRequest = new XMLHttpRequest;
httpRequest.onreadystatechange = test;
for(var i = 0; i < test.length; i++){
(function(i){
httpRequest.open('GET', 'https://test.com/' + test[i] , true);
})()}
httpeRequest.send();
}
}
I keep getting undefined for test[i]
though, and I'm not sure if this is how to correctly pass arrays through an httpRequest
either. I will appreciate any help with this.