拷贝属性
var extend = function(to, from){
for(var i in from){
if(!from.hasOwnProperty(i)) continue;
Object.defineProperty(
to,i,Object.getOwnPropertyDescriptor(from,i)
);
}
return to;
}
找到最长元素
function findLongest(array){
return array.reduce(function(longest,item){
return item.length > longest.length ? item:longest
},'');
}