i am designing a constructor function of an object type called Product that takes 3 parameters: aProdID, aDesc, and aPrice. displays the product object details by using alert(). For example, the output alert window should show the following if a product object is created with “A001”, “Coke”, “6” for the product number, product description, and product price respectively.
function product(aProdID, aDesc,aPrice){
var quantity=0
this.aProdID=aProdID;
this.aDesc=aDesc;
this.aPrice=aPrice;
return aProdID, aDesc,aPrice;
}
var product1= new product('A001','Coke',6)
alert(product1);
But it display [Object Object] What's wrong with that? thanks a lot
console.log()it shows much more information and allows you to track object references. In Chrome, you can activate the console withCtrl + Shift + I.