Skip to content

Instantly share code, notes, and snippets.

var array = [];
console.log("my array has " + array.length + " elements and it looks like: ", array);
console.log("WTF?");
array[5] = 1;
console.log("now my array has " + array.length + " elements and it looks like: ", array);
console.log("Okey...");
/*
results from Chrome-Safari console:
my array has 0 elements and it looks like: [undefined, undefined, undefined, undefined, undefined, 1]
@miguelrios
miguelrios / transparent_bg.js
Created December 18, 2010 23:35
Transparent Background in Processing JS
//width and height are the dimensions of your processing canvas.
processing.setup = function() {
processing.size(width, height);
processing.loadPixels();
for (var i = 0; i < processing.width*processing.height; i++){
processing.pixels.setPixel(i,0);
}
processing.updatePixels();
};