function DiffArray(a,b){
this.a = a;
this.b = b;
}
DiffArray.prototype.diff = function(){
var c = [];
var tmp = this.a.concat(this.b);
var o = {};
for (var i = 0; i < tmp.length; i ++) (tmp[i] in o) ? o[tmp[i]] ++ : o[tmp[i]] = 1;
for (x in o) if (o[x] == 1) c.push(x);
return c;
};
//使用方法
var a = [‘a‘,‘b‘,‘c‘,‘d‘,‘e‘];
var b = [‘d‘,‘e‘,‘f‘,‘g‘,‘h‘];
var point = new DiffArray(a,b);
var c = point.diff();