I've this code with a function, wherein a I'm trying to define an array
then on the next line pushing to it:
function Spot(value) {
this.x = null;
this.y = null;
this.values = [];
this.values.push(value);
}
I've tried this:
this.values = [].push(value);
and
this.values = (this.values || []).push(value);
But failed. Is there something wrong with the code.....
this.values = [ value ]
var spot = new Spot();