randpick.js:from从数组和字符串中获取随机项

时间:2021-05-13 17:10:19
【文件属性】:
文件名称:randpick.js:from从数组和字符串中获取随机项
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-13 17:10:19
select string random array item randpick.js 从数组和字符串中获取随机项。 安装 $ npm install randpick.js 用法 const randpick = require ( 'randpick.js' ) ; const emoji_array = [ ':bug:' , ':snail:' , ':hatching_chick:' , ':turtle:' , ':shark:' , ':spouting_whale:' , ':sauropod:' , ':lizard:' , ':cow:' , ':otter:' , ':T-Rex:' , ':parrot:' ] ; // An empty parameter equals 1. randpick . random ( emoji_array ) ; //=> ':spouting_whale:' // .random picks random items from an array and returns a new one. randpick . random ( emoji_array , 3 ) ; //=> [':
【文件预览】:
randpick.js-main
----package.json(670B)
----LICENSE(1KB)
----package-lock.json(71B)
----lib()
--------test.js(1KB)
--------randpick.js(4KB)
----README.md(1KB)

网友评论