Document sparse array behavior with {{#each
- Dominant language
- TypeScript
- Stars
- 22.6k
- Forks
- 4.2k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 15
Description
Hey!
I just noticed that Ember 2.10 introduces a changed behaviour when looping over indexed arrays with unset indexes.
Let's assume this array:
```js
let a = [];
a[5] = 'foo';
a[6] = 'bar';
```
and this hbs:
```hbs
{{#each testArray as |v k|}}{{k}},{{/each}}
```
In 2.9 this produces `5,6` and in 2.10 it produces `0,1,2,3,4,5,6`.
I also made a [twiddle](https://ember-twiddle.com/5e7d30c69358b5094ae644ddeaf9f947) for that
Contributor guide
Research direction
Start with the linked Ember Twiddle and reproduce the sparse-array example using the shown JavaScript array and Handlebars each loop. Document the differing Ember 2.9 and 2.10 output, including how unset indexes are handled; the work is done when this behavior is clearly recorded for users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- Half a day
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100