I am attempting to use the cocktailDB API to build a basic cocktail app and I'm looping through the results however I need to pull the ingredients out of the object but they are separate key value pairs (strIngredient 1-15). I've tried using a for in loop and can see all the properties of the object in the console but can't figure out how to loop through the ingredients to pull them out to render on the page.
var results = response.drinks;
for (var i = 0; i < results.length; i++) {
console.log(results[i]);
var eachDrink = results;
for (var prop in eachDrink[i]) {
console.log(eachDrink[i] [prop]);
}
}

You can use this code:
let myArray = [
{ type: "Fruit",
color: 'blue',
ingredient1: "salt",
ingredient2: "water"
}];
for(i=1; i <= 15; i++){
console.log('ingreditent' + i, myArray[0]['ingredient'+i]);
}
Or you can use this technique:
const array = { a3: 3, a2: 1, a1: 1, b: 2, c: 3 };
const keyWord = "a";
const filtered = Object.keys(array).filter(v => v.includes(keyWord))
result -> ["a3", "a2", "a1"];