# Array.prototype.ap

**URL:** <https://es.discourse.group/t/array-prototype-ap/1951>\
**Category:** 💡 Ideas\
**Tags:** proposal, iterator-helpers\
**Created:** [March 14, 2024, 10:07am UTC](https://es.discourse.group/t/array-prototype-ap/1951 "2024-03-14T10:07:21Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![brandonmcconnell](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/brandonmcconnell/32/2395_2.png) [@brandonmcconnell](https://es.discourse.group/u/brandonmcconnell)\
**Post date:** [March 15, 2024, 12:56am UTC](https://es.discourse.group/t/array-prototype-ap/1951/8 "2024-03-15T00:56:34Z")

</div>

Thanks, @rbuckton! Those are all great suggestions. I think I learned a thing or two too 😉

* * *

One other option that @theScottyJam [mentioned here](https://es.discourse.group/t/functional-destructuring-destructure-via-function-calls-using-new-syntax/1394/7) in my earlier Functional Destructuring proposal was to use the [extensions proposal](https://github.com/tc39/proposal-extensions), like this:

```js
for (const article of apiResponse) {
  const {
    title,
    subtitle,
    content,
    category,
    ::buildSlug: slug,
    ::getDaysSince: date,
    ::getWordCount: wordCount,
    ::getCharCount: charCount,
  } = article;
}

```

In the example we looked at above, it might look like this:

```js
const {
  ::getPieceName: pieceName,
  ::getPieceKey: pieceKey,
  ::getPieceColor: pieceColor,
  ::getStartPos: startPos,
  ::getCurrentPos: currentPos,
  ::getPieceAlg: pieceAlg,
  ::getPiecePos: piecePos,
  ::getMoveCount: moveCount,
  ::checkIfCurrentPiece: isCurrentPiece,
  ::checkIfOpponentPiece: isOpponentPiece,
} = piece;

```

If this works as he suggests, this should do exactly what I'm looking for here.

@hax would you mind shedding some light on this, seeing as you appear to be the author of that proposal?

---

_[View the full topic](https://es.discourse.group/t/array-prototype-ap/1951)._
