代码优化

This commit is contained in:
binaryify
2022-05-29 14:34:03 +08:00
parent 065d4aa111
commit 6bd63eb061
5 changed files with 10 additions and 7 deletions
+7
View File
@@ -14,4 +14,11 @@ module.exports = {
})
return obj
},
getRandom(num) {
var random = Math.floor(
(Math.random() + Math.floor(Math.random() * 9 + 1)) *
Math.pow(10, num - 1),
)
return random
},
}