let str = "13345157891"; const arr = [...str]; arr.splice(3, 4, '*', '*', '*', '*') console.log(arr.join(''));