Update mask.md
This commit is contained in:
@ -7,8 +7,7 @@ Omit the second argument, `num`, to keep a default of `4` characters unmasked. I
|
|||||||
Omit the third argument, `mask`, to use a default character of `'*'` for the mask.
|
Omit the third argument, `mask`, to use a default character of `'*'` for the mask.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const mask = (cc, num = 4, mask = '*') =>
|
const mask = (cc, num = 4, mask = '*') => `${cc}`.slice(-num).padStart(`${cc}`.length, mask);
|
||||||
('' + cc).slice(-num).padStart(('' + cc).length, mask);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in New Issue
Block a user