【文件属性】:
文件名称:to-digits:将数字转换为数字数组
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-11 19:53:11
JavaScript
位数
将数字转换为数字数组。
安装
$ npm install to-digits
var toDigits = require ( 'to-digits' ) ;
用法
toDigits(数字)
toDigits ( 7654 ) ; // [7, 6, 5, 4]
toDigits.extend
使用它来扩展本机Number.prototype:
Number . prototype . toDigits = toDigits . extend
console . log ( ( 456 ) . toDigits ( ) ) // [4, 5, 6]
【文件预览】:
to-digits-master
----test.js(599B)
----.travis.yml(38B)
----.gitignore(20B)
----index.js(291B)
----readme.md(618B)
----package.json(688B)