`.reverse` and `.toReversed` methods to accept arg to control whether to use or ignore the operation

Almost any time I need to reverse an array, it's a conditional operation, which leads me to do something like this:

const arr = [1, 2, 3];
let sortReversed = true; // reactive variable

const processedArr = sortReversed ? arr.slice().reverse() : arr;
// ...or...
const processedArr = sortReversed ? arr.toReversed() : arr;

It would be great to be able to simply pass in the reactive variable, so I can do something like this:

const processedArr = arr.slice().reverse(sortReversed);
// ...or...
const processedArr = arr.toReversed(sortReversed);

This is especially useful when I need to conditionally swap destructure two variables from a tuple-style array that is conditionally reversed. Here is my present IRL example:

let [organization, individual] = [provider, focalProvider];

if (focalEntityType === EntityTypeCode.Organization) {
  [organization, individual] = [individual, organization];
}

If I want to declare these array objects with const, it would looks more like this:

const [organization, individual] = focalEntityType === EntityTypeCode.Organization
  ? [focalProvider, provider]
  : [provider, focalProvider];

With an argument supplied to reverse and toReversed, we could achieve the same much simpler like this:

const [organization, individual] = [provider, focalProvider].slice().reverse(focalEntityType === EntityTypeCode.Organization);
// ...or...
const [organization, individual] = [provider, focalProvider].toReversed(focalEntityType === EntityTypeCode.Organization);

I don't see why you can't simply define a helper function.

const toReversedIf = (sortReversed, arr) =>
  sortReversed ? arr.toReversed() : arr;

const arr = [1, 2, 3];

let sortReversed = true; // reactive variable

const processedArr = toReversedIf(sortReversed, arr);

const [organization, individual] = toReversedIf(
  focalEntityType === EntityTypeCode.Organization,
  [provider, focalProvider],
);

I don't see any good reason to add a flag to the reverse or toReversed methods for this use case. Adding this flag is a form of control coupling. To quote Wikipedia:

Control coupling is one module controlling the flow of another, by passing it information on what to do (e.g., passing a what-to-do flag).

Control coupling is a code smell and it should be avoided. The reverse and toReversed methods are perfect. They don't need to be modified. If you want to reverse an array conditionally then you should create your own helper function instead of trying to modify the reverse or toReversed methods.