Open this example in the interactive library
Source code
const value = "123456789";
console.log(value.slice(-4).padStart(value.length, "•"));
Sample output
•••••6789

Open this example in the interactive library
const value = "123456789";
console.log(value.slice(-4).padStart(value.length, "•"));
•••••6789