knockout / knockout

Knockout makes it easier to create rich, responsive UIs with JavaScript
http://knockoutjs.com/
Other
10.43k stars 1.52k forks source link

observableArray.removeAll() -> c is null #2568

Closed sirber closed 2 years ago

sirber commented 3 years ago

image

sirber commented 3 years ago

image

sirber commented 3 years ago

my code is at problem here, but a null check could be nice. or a (falsy) => [ ]

mbest commented 2 years ago

There was a discussion at one point about not allowing a null or undefined value for an observable array, but since it was a breaking change we decided against it. I think throwing an exception in this case is fine.