手机号加星

1
2
3
4
5
6
7
8
9
var data={
list:[13000000000, 13156478901],
yanma:[]
};
for(a of data.list){
var str = String(a);
data.yanma.push(str.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'))
}
console.log(data);