Skip to content

_.random document lower > upper value swap#6115

Merged
jonchurch merged 1 commit intolodash:mainfrom
jonchurch:random-doc-fix
Feb 23, 2026
Merged

_.random document lower > upper value swap#6115
jonchurch merged 1 commit intolodash:mainfrom
jonchurch:random-doc-fix

Conversation

@jonchurch
Copy link
Copy Markdown
Member

Closes #6113

tldr; _.random(lower, upper) takes positional lower and upper args, but it is undocumented that it will shuffle the args into lower and upper despite position.

If lower is greater than upper, the values are swapped.

@jonchurch jonchurch merged commit 0783181 into lodash:main Feb 23, 2026
30 checks passed
@jonchurch jonchurch deleted the random-doc-fix branch February 23, 2026 06:14
flavioespinoza pushed a commit to flavioespinoza/lodash that referenced this pull request Mar 2, 2026
flavioespinoza pushed a commit to flavioespinoza/lodash that referenced this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants