# ember/template-no-array-prototype-extensions
💼 This rule is enabled in the 📋 `template-lint-migration` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
Disallow usage of Ember Array prototype extensions.
Ember historically provided Array prototype extensions like `firstObject` and `lastObject`. These extensions are deprecated and should be replaced with native JavaScript array methods or computed properties.
## Rule Details
This rule disallows using Ember Array prototype extensions in templates:
- `firstObject`
- `lastObject`
- `@each`
- `[]`
## Examples
### Incorrect ❌
```gjs
{{this.items.firstObject}}
```
```gjs
{{this.users.lastObject}}
```
```gjs
{{this.data.@each}}
```
### Correct ✅
```gjs
{{get this.items 0}}
```
```gjs
{{this.firstItem}}
```
```gjs
{{#each this.items as |item|}}
{{item}}
{{/each}}
```
## Related Rules
- [no-array-prototype-extensions](./no-array-prototype-extensions.md)
## References
- [Ember Deprecations - Array prototype extensions](https://deprecations.emberjs.com/v3.x/#toc_ember-array-prototype-extensions)
- [eslint-plugin-ember template-no-array-prototype-extensions](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-array-prototype-extensions.md)