I have initialized a buffer array for use:
for (h = 0; h < this.height; h += 1) { this.buffer.push([]); for (w = 0; w < this.width; w += 1) {