Skip to content

Ember.Array methods return Array rather than Ember.Array #12003

@indirect

Description

@indirect

Ember.Array methods that return an array, like filterBy, return a bare JS Array rather than an Ember.Array. This makes chaining Ember.Array methods impossible with prototype extensions disabled. Here's an example:

// prototype extensions on
Ember.A(someArray).filterBy(‘property’).mapBy('otherProperty') // => [1, 2, 3]

// prototype extensions off
Ember.A(someArray).filterBy('property').mapBy('otherProperty') // => undefined is not a function

Ember.A(Ember.A(someArray).filterBy('property')).mapBy('otherProperty') // => [1, 2, 3]

I can't find any discussion of this in the documentation, so I'm opening an issue. It seems like it would make sense for Ember.Array methods that return an array to return an Ember.Array, so that chaining Ember.Array methods becomes possible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions