MutableArray#clear()

clearEmber.Arraypublic

Defined in packages/ember-runtime/lib/mixins/mutable_array.js:87

Remove all elements from the array. This is useful if you want to reuse an existing array without having to recreate it.

let colors = ['red', 'green', 'blue'];

color.length();   //  3
colors.clear();   //  []
colors.length();  //  0

Returns:

Ember.Array
An empty Array.
doc_EmberJs
2016-11-30 16:52:33
Comments
Leave a Comment

Please login to continue.