JS: Mask all except the last four digits

This is from an exercise for in-between that I fished out of the net. The aim is to mask all numbers with an X or an asterisk, similar to credit card entries.

The personal solution is waiting in the detailed view of the article.

Example Number: 123456789

Result: 12345****


JS: Mask all except the last four digits weiterlesen