Mis objetos de clase no se muestran desde el objeto principal en el registro de la consola
// Inventory , the main class class Inventory{ constructor(shoe,customer){ this.shoes = []; this.customers = []; } addShoes(shoe){ this.shoes.push(shoe); } addCustomers(customer){ this.customers.push(customer); } } // Customer class class Customer{ constructor(name,address,phone){ this.name = name; this.address = address; this.phone = phone; } } //Shoes class class Shoes{ constructor(brand,name,color,size){ this.brand = brand; this.name = name; this.colors = []; this.sizes = []; } addColors(color){ this.colors.push(color); } addSizes(size){ this.sizes.push(size); } } // Where I put in the data for the object values, to display to console log const inventory = new Inventory(); const myko = new Customer("Myko","216 Peachtree",9144444444); const shoes = new Shoes("Nike","Air Force 1"); shoes.addColors(["Black/Green","Blue/white","Red/Blue","White/Red"]); shoes.addSizes([12,10,9,11]); const newAdd = new Inventory(shoes,myko); console.log(newAdd);lo que muestra el registro de mi consola, datos vacíos
Inventario {zapatos: Array(0), clientes: Array(0)} clientes: Array(0)
Quiero que se muestre el registro de la consola, cuando ingrese los datos cuando llamo a la clase de inventario en console.log
Inventario {zapatos: Array(1), clientes: Array(1)}
clientes: "Myko", "216 Peachtree", 9144444444"
zapatos: "Nike", "Air Force 1", "Negro/Verde", "Azul/blanco", "Rojo/Azul", "Blanco/Rojo", 12, 10, 9, 11
No inicializaste el inventario con el parámetro en el constructor. ([] en cambio.)
class Inventory{ constructor(shoe,customer){ this.shoes = shoe; this.customers = customer; } }