Skip to content

Instantly share code, notes, and snippets.

@asifvora
Created March 15, 2019 05:44
Show Gist options
  • Select an option

  • Save asifvora/93c9ebc63501b7c455731ef3a6617aeb to your computer and use it in GitHub Desktop.

Select an option

Save asifvora/93c9ebc63501b7c455731ef3a6617aeb to your computer and use it in GitHub Desktop.

Revisions

  1. asifvora created this gist Mar 15, 2019.
    3 changes: 3 additions & 0 deletions masks.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    const mask = (str, maskChar = "#") => str.slice(-4).padStart(str.length, maskChar);

    mask("123456789"); // "#####6789"