Ko.observableArray () without adding elements
I tried KO but I am having problems getting the ObservableArray to work, the code is very simple
โ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);โโ
For some reason, the length of the knockout array is 0 and the length of the regular array is 1.
Why is this happening?
+3
source to share