Skip to content

Instantly share code, notes, and snippets.

@gserb
Last active June 21, 2019 07:51
Show Gist options
  • Save gserb/90ce59d38c5798217ba1a8454fbfc14a to your computer and use it in GitHub Desktop.
Save gserb/90ce59d38c5798217ba1a8454fbfc14a to your computer and use it in GitHub Desktop.
padStart polyfill
if (!String.prototype.padStart) {
String.prototype.padStart = function (n,str){
return Array(n-String(this).length+1).join(str||'0')+this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment