I have an array of objects and I want to iterate it and print the field of the objects.
Example console log:
2:{id: "15", nombre: "Intrafungol", categoria: "Antifungicos", efecto: "Lucha
contra la Tiña.", efecto_secundario: "Puede ocasionar hipersalivación,
vómitos, diarrea y/o anorexia.", …}
So this is an example. I want to print the name of all medicines. And my code is not working
function process_data(medicines) {
for(var medicine in medicines ) {
console.log(medicine["name"]);
Thanks a lot!
Object.keys(medicines)in yourfor