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/>");
}

---------------------------------------------------------------------------------

posted @ 2019-04-23 16:02  Alice的小屋  阅读(511)  评论(0编辑  收藏  举报