i can push an item to prices array when invoked in console but not when i click the button..
<input type="text" id = "currentPrice">
<button type="button" id = "calcButton">Show</button>
var Newchart = function () {
this.prices = []
}
Newchart.prototype.addNewprice = function () {
var priceValue = +(document.getElementById('currentPrice').value);
this.prices.push(priceValue);
console.log('hello')
}
var c = new Newchart();
var el = document.getElementById("calcButton");
el.addEventListener("click", c.addNewprice, false);