Skip to content

Commit

Permalink
Merge pull request #18386 from mukilane/docs/ember-array-firstObject
Browse files Browse the repository at this point in the history
[DOC] Added example for EmberArray#firstObject
  • Loading branch information
locks authored Sep 25, 2019
2 parents 122ebec + 6f6fd33 commit 5117d1b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/@ember/-internals/runtime/lib/mixins/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,20 @@ const ArrayMixin = Mixin.create(Enumerable, {
/**
The first object in the array, or `undefined` if the array is empty.
```javascript
let vowels = ['a', 'e', 'i', 'o', 'u'];
vowels.firstObject; // 'a'
vowels.shiftObject();
vowels.firstObject; // 'e'
vowels.reverseObjects();
vowels.firstObject; // 'u'
vowels.clear();
vowels.firstObject; // undefined
```
@property firstObject
@return {Object | undefined} The first object in the array
@public
Expand Down

0 comments on commit 5117d1b

Please sign in to comment.