function tel(tel) { const telNum = tel.toString(); const reg = /^(\d{3})\d{4}(\d{4})$/; return telNum.replace(reg, ‘$1****$2‘) } tel(13212341234)
手机号码中间四位加星号
原文:https://www.cnblogs.com/boystao/p/13093655.html