我正在尝试KO,但在运行observableArray时遇到了问题,代码非常简单
var test = new ko.observableArray();
var regulararray = [];
test.push("item");
regulararray.push("regularpush");
console.log("the length for ko: " + test.length + " the length for regular array: " + regulararray.length);由于某些原因,敲出数组的长度为0,而常规数组的长度为1。
为什么会发生这种情况?
发布于 2012-03-28 14:54:52
使用test().length而不是test.length
https://stackoverflow.com/questions/9902328
复制相似问题