Stack error message
I'm getting a maximum stack error message, this program is supposed to discount 15% off of the original price. function main() { var prodID = readLine(); var price = parseInt(readLine(),10); var discount = parseInt(readLine(),10); var prod1= new Product(prodID, price); console.log(prod1.prodID + " price: " + prod1.price); prod1.changePrice(discount); console.log(prod1.prodID + " new price: " + prod1.price); } function Product(prodID, price) { this.prodID = prodID; this.price = price; this.changePrice = function(discount) { //your code goes here var p = price * discount; var newPrice = price - p; var t = new Product(price) t.changePrice(newPrice); } }