As a beginner in the world of programming, I usually rely on online resources to solve my coding problems. However, this time I'm facing an issue that I can't find the solution to online. I have been trying to push a variable into an array and then checking if it actually made it into the array by using console.log. But instead of seeing the names of the variables I pushed in like "card_Fireball" or "card_Waterbolt", all I see is [Card, Card]. The code snippet I am working with is as follows:
var Deck = [];
function Card(name, type, cost, points, damage, heal){
this.name = name;
this.type = type;
this.cost = cost;
this.points = points;
this.damage = damage;
this.heal = heal;
}
var card_Fireball = new Card("Fireball", "spell", 2, 1, 3, 0);
var card_Waterbolt = new Card("Waterbolt", "spell", 2, 1, 3, 0);
Deck.push(card_Fireball);
Deck.push(card_Waterbolt);
console.log(Deck);
While I believe the solution to this problem might be simple, my lack of experience as a beginner programmer is making it hard for me to figure out. Any help would be greatly appreciated! Thank you so much!