Skip to content

Instantly share code, notes, and snippets.

@lichenbuliren
Created January 4, 2017 09:47
Show Gist options
  • Save lichenbuliren/3bf641bf8e41d45e4d1039b4fa121b66 to your computer and use it in GitHub Desktop.
Save lichenbuliren/3bf641bf8e41d45e4d1039b4fa121b66 to your computer and use it in GitHub Desktop.
一些 js 小技巧
// 保留两位数字符
const twoDigits = (num) => ('0' + num).slice(-2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment