# List Comprehension

**URL:** <https://es.discourse.group/t/list-comprehension/112>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [October 25, 2019, 4:26pm UTC](https://es.discourse.group/t/list-comprehension/112 "2019-10-25T16:26:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Jonas\_Wilms](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jonas_wilms/32/189_2.png) [@Jonas\_Wilms](https://es.discourse.group/u/Jonas_Wilms)\
**Post date:** [October 28, 2019, 3:50pm UTC](https://es.discourse.group/t/list-comprehension/112/3 "2019-10-28T15:50:13Z")

</div>

First of all, I generally like the idea of simplyfiying the process of building up arrays from logic.

However, I do have a few concerns:

`for`, `async` and others are fundamental _statements_ of the language, now they are suddenly used as _expressions_ . The only way I can think of, for this to work in the way you propose it, is to introduce a whole new set of syntax, that redefines these keywords.

That's a lot of new syntax, just to support little new functionality ... I mean, there is already:

```javascript
const result = [...(function*() {
  for (year of years) if (year > 2000 && year < 2010) yield year;
})()];

```

---

_[View the full topic](https://es.discourse.group/t/list-comprehension/112)._
