//数组去重
var keys=["a","b","a","c"];
var res = [], hash = {};
for(var i=0; i<keys.length; i++) {
if (!hash[keys[i]])
{
res.push(keys[i]);
hash[keys[i]] = true;
}
}
var keys=["a","b","a","c"];
var res = [], hash = {};
for(var i=0; i<keys.length; i++) {
if (!hash[keys[i]])
{
res.push(keys[i]);
hash[keys[i]] = true;
}
}