Update mask.md

This commit is contained in:
Angelos Chalaris
2018-09-26 12:27:04 +03:00
committed by GitHub
parent 77167a059d
commit e2a1310db1

View File

@ -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