diff --git a/snippets/mask.md b/snippets/mask.md index 472cd3ed0..46d31bbad 100644 --- a/snippets/mask.md +++ b/snippets/mask.md @@ -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