# Provide an easy way to create a new array, filled via a mapping function

**URL:** <https://es.discourse.group/t/provide-an-easy-way-to-create-a-new-array-filled-via-a-mapping-function/1056>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [October 25, 2021, 11:54am UTC](https://es.discourse.group/t/provide-an-easy-way-to-create-a-new-array-filled-via-a-mapping-function/1056 "2021-10-25T11:54:38Z")\
**Posts on this page:** 1\
**Showing post:** 56

<div class="post-metadata">

**Author:** ![aaditmshah](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/aaditmshah/32/602_2.png) [@aaditmshah](https://es.discourse.group/u/aaditmshah)\
**Post date:** [September 21, 2022, 8:19am UTC](https://es.discourse.group/t/provide-an-easy-way-to-create-a-new-array-filled-via-a-mapping-function/1056/56 "2022-09-21T08:19:28Z")

</div>

By the way, the `Array.from` function was meant for converting iterables into arrays. However, I have never used it for that purpose because using the spread operator is a nicer way to convert iterables into arrays.

```javascript
// when not mapping
const a = Array.from(someIterable);
const b = [...someIterable];

// when mapping
const c = Array.from(someIterable, mappingFn);
const d = [...someIterable].map(mappingFn);

```

In fact, the only time I ever use `Array.from` is specifically when I want to create an array of a specific length, i.e. I always write something like `Array.from({ length: n }, (_, i) => …)`. So, I personally never use `Array.from` for its intended purpose. I only ever use it to create arrays of a specific length.

This is all the more reason to add `Array.create` to the language.

Anyway, I think I've done enough bikeshedding for today. I firmly believe that `Array.create` is a great addition to the language. From what I read, I also believe that everybody else is of the same opinion. If the committee is so against adding a simple quality of life function to the language, then that's their choice. I've said everything that I want to say.

---

_[View the full topic](https://es.discourse.group/t/provide-an-easy-way-to-create-a-new-array-filled-via-a-mapping-function/1056)._
