Right now, what I want to do is write an Array.prototype
function union( array_to_union )
, and I want to call it like this below:
var a = [1,2,3];
a.union([2,3,4]).union([1,3,4]) ......
and the result will be the union of those array, I wonder how can I do that?
I only know I should use Array.prototype.union = function( array_to_union){.....}
.