In Node, I need to turn a credit card into something like this before rendering the view layer: ************1234
.
Without loops and ugliness is there a utility or one liner for this? The credit card can potentially look one of these ways:
1234567898765432
1234-5678-9876-5432
1234 5678 9876 5432