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.
|
||||
|
||||
```js
|
||||
const mask = (cc, num = 4, mask = '*') =>
|
||||
('' + cc).slice(-num).padStart(('' + cc).length, mask);
|
||||
const mask = (cc, num = 4, mask = '*') => `${cc}`.slice(-num).padStart(`${cc}`.length, mask);
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user