Skip to content

Instantly share code, notes, and snippets.

@Andyliwr
Created June 4, 2019 01:57
Show Gist options
  • Save Andyliwr/eccb70b74ad815d0b24db31c08c55646 to your computer and use it in GitHub Desktop.
Save Andyliwr/eccb70b74ad815d0b24db31c08c55646 to your computer and use it in GitHub Desktop.
随机生成手机号码
const headerNums = new Array("139","138","137","136","135","134","159","158","157","150","151","152","188","187","182","183","184","178","130","131","132","156","155","186","185","176","133","153","189","180","181","177");
const headerNum = headerNums[parseInt(Math.random() * 10 ,10)]
const bodyNum = Math.random().toString().replace('0.', '').slice(0, 8)
console.log(headerNum + bodyNum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment