Ember.js: Ember.Array and replace()

Created on 3 Nov 2017  路  1Comment  路  Source: emberjs/ember.js

In the documentation, strings are used in Enumerables together with pushObject() [e.g. in https://guides.emberjs.com/v2.16.0/object-model/enumerables/]

let arr = Ember.A(['first', 'second', 'third']);
arr.replace(0, 1, 'new-first');
arr.replace(1, 1, '');
arr.pushObject('')'

The arr contains ['new-first', 'third', '']. According to documentation (usage with objects) I would expect that it should just replace 'second' with an empty string. Am I right?

Bug Has PR

Most helpful comment

The third argument for replace needs to be a collection.

>All comments

The third argument for replace needs to be a collection.

Was this page helpful?
0 / 5 - 0 ratings