I have a main array and I want to create other arrays in the main array, as the sub arrays will have data for egg, baby, intraining.
I am not sure if this is the correct way of doing it?
The reason why I want to do it this way,is that, if I want to access the egg.name in the digiListarray, I know it would work without any errors poping up when I do console.log(digiList.egg.name)
Currently the error I get is Egg is not defined
const digiList = [
egg = [
{
id:"blue",
eggtype:"blue",
digivolution:"Punimon",
image:"../Images/Blue Egg - mobile.png"
},
],
baby =[
{
id:"botamon",
name:"Botamon",
stage:"Baby",
type:"Data",
preDigivolution:["green"],
digivolution:["Koromon"],
image: "https://www.grindosaur.com/img/games/digimon-world/digimon/12-botamon.jpg"
},
intraining = [
{
id:"koromon",
name:"Koromon",
stage:"In-training",
type:"Data",
preDigivolution:["Botamon"],
digivolution:["Agumon","Gabumon","Kunemon"],
image: "https://www.grindosaur.com/img/games/digimon-world/digimon/50-koromon.jpg"
}
]
]
]
console.log(digiList.egg.name)