Clearing an array and binding

Hi, Guys.

I just discovered an issue which may arise when binding to arrays.
A way of clearing an array in es6 is: someArrayInstance.length = 0;

This doesn’t work as I expected. Aurelia didn’t notice.

You have to do the usual and recommended way:

someArrayInstance.splice(0, someArrayInstance.length);

cheers!

1 Like