var data = ["ab", "c"];
function handleData ( arg ){
var data = arg;
console.log(data.length);
}
It"s okay to have strings in the array, but if you change it to a json object, you can"t get the length correctly
.var data01 =[{"mid":1,"name":"","content":"","pubtime":"2018-10-21T17:32:57.000Z","examine":0},{"mid":2,"name":"","content":"","pubtime":"2018-10-21T17:33:52.000Z","examine":0},{"mid":3,"name":"","content":"","pubtime":"2018-10-21T17:34:57.000Z","examine":0},{"mid":4,"name":"","content":"","pubtime":"2018-10-21T17:35:50.000Z","examine":0},{"mid":5,"name":"","content":"","pubtime":"2018-10-21T18:00:04.000Z","examine":0},{"mid":6,"name":"","content":"","pubtime":"2018-10-21T18:03:37.000Z","examine":0},{"mid":7,"name":"","content":"","pubtime":"2018-10-21T18:03:50.000Z","examine":0},{"mid":8,"name":"","content":"","pubtime":"2018-10-21T18:05:12.000Z","examine":0},{"mid":9,"name":"","content":"","pubtime":"2018-10-21T18:05:16.000Z","examine":0},{"mid":10,"name":"","content":"","pubtime":"2018-10-21T18:05:50.000Z","examine":0},{"mid":11,"name":"","content":"","pubtime":"2018-10-21T18:06:18.000Z","examine":0},{"mid":12,"name":"","content":"","pubtime":"2018-10-21T18:17:37.000Z","examine":0},{"mid":13,"name":"","content":"","pubtime":"2018-10-21T18:45:13.000Z","examine":0},{"mid":14,"name":"","content":"","pubtime":"2018-10-21T18:45:18.000Z","examine":0},{"mid":15,"name":"","content":"","pubtime":"2018-10-21T18:45:26.000Z","examine":0},{"mid":16,"name":"","content":"","pubtime":"2018-10-21T18:45:41.000Z","examine":0}]
function handleData ( arg ){
var data = arg;
console.log(data.length);
}
the output is
data.length = 1493
but the result I want is 16
what caused it