Why doesn't ko.observableArray.length return length of underlying array?
问题 Using Knockout, when working with an observableArray , you must grab the underlying array ( myArray() ) in order to read the length. I don't understand why myArray.length wouldn't return the underlying array's length (instead it returns 0). Is this a bug or is there reason which I've simply missed? JSFiddle: http://jsfiddle.net/jsm11482/LJVWE/ JS/Model var data = { name: ko.observable("Test"), items: ko.observableArray([ { name: ko.observable("First Thing"), value: ko.observable(1) }, { name: