1.
phone.substr(0,3) + '****' + phone.substr(7)
2.
var tel = "13800001234"; var reg = /^(\d{3})\d{4}(\d{4})$/; tel = tel.replace(reg, "$1****$2"); console.log(tel);
1.
phone.substr(0,3) + '****' + phone.substr(7)
2.
var tel = "13800001234"; var reg = /^(\d{3})\d{4}(\d{4})$/; tel = tel.replace(reg, "$1****$2"); console.log(tel);