<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
function phone(mobile, len = 3) {
return String(mobile).slice(0, len * -1) + "*".repeat(len);
}
console.log(phone(98765432101));
</script>
</body>
</html>
js电话号码简单实现小例子
于 2022-02-26 23:07:13 首次发布