js - 两个列表去重,列表是字典,正则替换,时间串的截取
https://www.cnblogs.com/jiayuexuan/p/7527055.html
两列表:类似:
arr1 = [ {uid:1,name:"aaa"},{uid:1,name:"aaa"},{uid:2,name:"bbb"} ]
arr2 = [ {uid:3,name:"ccc"},{uid:2,name:"bbb"},{uid:4,name:"ddd"} ]
// 正则替换掉 \r\n <br/>
var r = new RegExp("[\r\n]","img");
for(var i in res.data){
res.data[i].ncontent=res.data[i].content.replace(r,"<br/>");
}
---------------------------------------------------------------------------------