Update mask.md

This commit is contained in:
Angelos Chalaris
2020-01-22 12:47:46 +02:00
committed by GitHub
parent 6f2e8fd49c
commit 3770bbfc32

View File

@ -1,6 +1,6 @@
---
title: mask
tags: string,utility,regexp,intermediate
tags: string,utility,intermediate
---
Replaces all but the last `num` of characters with the specified mask character.
@ -17,4 +17,4 @@ const mask = (cc, num = 4, mask = '*') => `${cc}`.slice(-num).padStart(`${cc}`.l
mask(1234567890); // '******7890'
mask(1234567890, 3); // '*******890'
mask(1234567890, -4, '$'); // '$$$$567890'
```
```