Menu
What is this syntax: Array.prototype.unique
What does it mean? What does it do?
Also, can someone explain what the following code does?
[CODE]
Array.prototype.unique = function () {
var r = new Array();
o:for(var i = 0, n = this.length; i < n; i++)
{
for(var x = 0, y = r.length; x < y; x++)
{
if(r[x]==this[i].category)
{
continue o;
}
}
r[r.length] = this[i].category;
}
return r;
}