Skip to content

Instantly share code, notes, and snippets.

@jeena
jeena / gist:4100386
Created November 17, 2012 21:18 — forked from ttepasse/gist:4100377
function MyArray () {
console.log("bla");
Array.call(this);
}
MyArray.prototype = Object.create(Array.prototype)
var x = new MyArray()
x.push("lala")
x.push("lolo")
begin
headers = values
next
end unless headers
Array.prototype.unique = function() {
var uniqueKeys = {},
uniqueArray = [],
items = this.length
while( items )
uniqueKeys[this[--items]] = true
for( var key in uniqueKeys )
if (uniqueKeys.hasOwnProperty(key)) uniqueArray.push(key)