Skip to content

Conversation

Payal-Goswami
Copy link
Contributor

@Payal-Goswami Payal-Goswami commented Oct 11, 2025

Resolves #8227

Description

This pull request:

  • Replaced new Array() constructor with an array literal in @stdlib/utils/some-by-right example and updated README accordingly.

Related Issues

This pull request:

Questions

No.

Other

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 11, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
utils/some-by-right $\color{green}135/135$
$\color{green}+100.00\%$
$\color{green}15/15$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}135/135$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Oct 11, 2025
@Payal-Goswami
Copy link
Contributor Author

Payal-Goswami commented Oct 11, 2025

Hi, I noticed that we could also generate the array using @stdlib/random/array/randu (e.g., var arr = randu(100);) instead of manually pushing random numbers in a loop. However, I kept the explicit loop since it seems to better illustrate how someByRight() traverses the array from right to left. Please let me know if you’d prefer switching to randu().

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Oct 13, 2025
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Oct 13, 2025
@stdlib-js stdlib-js deleted a comment from stdlib-bot Oct 13, 2025
@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Ready To Merge A pull request which is ready to be merged. labels Oct 13, 2025
@Planeshifter
Copy link
Member

Hi, I noticed that we could also generate the array using @stdlib/random/array/randu (e.g., var arr = randu(100);) instead of manually pushing random numbers in a loop. However, I kept the explicit loop since it seems to better illustrate how someByRight() traverses the array from right to left. Please let me know if you’d prefer switching to randu().

That would be better; would you mind changing the example code to use the array random PRNG package instead, please? In general, we want to move away from having for-loops in our example code.

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refactor to use the array PRNG equivalent. Also notice that the example code in the README.md file currently contains a duplicated var arr; this should be rectified as part of the refactoring. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Needs Changes Pull request which needs changes before being merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants