How do I return a single value from a for loop over an array of objects?

I currently have a for loop with the var i increasing over the length of the array of objects. Console.logging it returns the entire array of objects, but I just want a random single value. I have got the for loop to return objects in random order, but how do I return just a single value from this? I will appreciate any help or if anyone can lead me to a similar problem on stack overflow that is answered.
here is my relevant code :
function randomQuote(){
if(httpRequest.readyState === XMLHttpRequest.DONE){
if(httpRequest.status === 200){
var data = JSON.parse(this.response);
var randomresponse = data.map(quote => quote.quote);
console.log(randomresponse);
} else {
alert(‘there was a problem with the request’);
}
}
}
and here is my codepen: https://codepen.io/icewizard/pen/xpdpWK

Yeah I already knew all of that and was doing it in my code, but thanks anyway I figured it out. And I got rid of my for loop, changed it to a .map, I’m not sure which one is faster though but the code looks cleaner to me and easier to read.
here is my new code if you’re interested: function randomQuote(){
if(httpRequest.readyState === XMLHttpRequest.DONE){
if(httpRequest.status === 200){
var data = JSON.parse(this.response);
var randomresponse = data[Math.floor(Math.random() * data.length) ]
console.log(randomresponse.quote);
} else {
alert(‘there was a problem with the request’);
}
}
}

thanks again!

oops I meant I removed the for loop and .map entirely. Don’t need it here. thanks.

How exactly did you download the quotes just once and then reference the data? I’m not even sure how to begin to do this. I’ll appreciate it if you could give me some pointers on that.

thank you!!!