randomValue (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Subhajit Sahu edited this page
May 3, 2023
Pick an arbitrary value.
Similar: randomValue, values, hasValue, searchValue.
function randomValue(x, fr) // x: an array // fr: random number generator ([0, 1))
const xarray = require('extra-array');
var x = [1, 2, 3]; xarray.randomValue(x); // → 3
xarray.randomValue(x); // → 2