
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
randomise-array
Advanced tools
Library to help you randomise arrays, and generate new ones with any length visit on github
To install randomise-array, run
npm install randomise-array --save
randomise-array is very easy to use
var randomise = require('randomise-array')
var myArray = [ 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ]
randomise(myArr)
//> [ 1, 3, 4, 8, 7, 2, 6, 2, 5, 7 ]
randomise(myArr, {
length: 5,
unique: true,
})
//> [ 1, 9, 5, 7, 10 ]
randomise(myArr, {
length: 20,
gte: 5,
lte: 8
})
//> [ 6, 5, 5, 7, 8, 8, 6, 8, 5, 6, 8, 7, 7, 6, 8, 8, 6, 8, 5, 5 ]
randomise(arr, [options])
arr: Array = 'old array'
options = {
length: Number = 'length of new array',
unique: Boolean = 'unique values for each item in array',
gte: Number = 'greater than or equal to',
lte: Number = 'less than or equal to'
}
randomise-array is licensed under the MIT license.
FAQs
Randomise arrays and generate a new array with any given length
We found that randomise-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.