Panwo,
var a = [
[1, 2, 3, 3, 4],
[, , 3, 3, ],
[, 1, 3, 3, ],
[, , 3, 3, ],
[5, , 3, 3, ]
];
function getLetters(a) {
var letters = new Array();
var i, j;
Array.prototype.hasObject = (!Array.indexOf ? function(o) {
var l = this.length + 1;
while (l -= 1) {
if (this[l - 1] === o) return true;
}
return false;
} : function(o) {
return (this.indexOf(o) !== -1);
});
for (i = 0; i < 5; i++) {
for (j = 0; j < 5; j++) {
if (a[i][j] && !letters.hasObject(a[i][j])) {
letters.push(a[i][j]);
}
}
}
return letters;
}
alert(getLetters(a))