make * substitutions for the specified range of elements.
is there a better regular way to hide numbers?
writes how to handle a string. The demo is as follows:
//
hideCertificate(number) {
let a = "12345678";
let len = a.length;
let res;
res = `${a.substr(0, len / 2 / 2)}${new Array(Math.floor(len / 2)).fill("*").join("")}${a.substr(-(len / 2 / 2))}`;
console.log(res);
// 12****78
},