var data = [{
"beer_names": [
"Apple Ale",
"Bad Seed Pumpkin Ale"
],
"brewery": "Basil T's Brew Pub and Italian Grill"
}, {
"beer_names": [
"5 C's IPA",
"Bottle Rocket IPA",
"Kate The Great Russian Imperial Stout",
"Wheat Wine"
],
"brewery": "Portsmouth Brewery"
}, {
"beer_names": [
"Black Forest Dunkelweizen",
"Equinox E.S.B.",
"Evolutionary IPA",
"G.E. Lite",
],
"brewery": "Glen Ellyn Sports Brew"
}];
for(i = 0; i <= data.length; i++) {
console.log(data[i].beer_names[0]);
}
- сейчас выводятся только первые beer_names, как вывести все?
Ожидаемый результат:
Apple Ale
Bad Seed Pumpkin Ale
5 C's IPA
Bottle Rocket IPA
Kate The Great Russian Imperial Stout
Wheat Wine
Black Forest Dunkelweizen
Equinox E.S.B.
Evolutionary IPA
G.E. Lite
JSFiddle