I have an observable array as:
self.myArray = ko.observableArray([1234]);
I am trying to clear an observable array as two different ways:
self.myArray([]) // Step X
self.myArray.removeAll() // Step X
But the value isn't emptied, and then I have to perform:
self.myArray = ko.observableArray([]); // Step Y
Is step X's same as step Y?
Are you sure your array is not empty after
removeAll()?The test would be
self.myArray().length === 0: