<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
<script type="text/javascript">
function phone(num,len){
return String(num).slice(0,len*-1)+"*".repeat(len)
}
console.log(phone(12345678901,4));//1234567****
</script>