6kyu
函数的连续调用
function createMessage(str) {
return function(next){
if (next === undefined) {return str;}
return createMessage(str + " "+ next);
}
}两个数组去重
## 遍历b来除去a中相同的
function array_diff(a, b) {
b.map(function(item){
if(a.indexOf(item)!=-1){
while(a.indexOf(item)!=a.lastIndexOf(item)){
a.splice(a.indexOf(item),1)
}
a.splice(a.indexOf(item),1)}
})
return a
}检测网址的主域名
Last updated