js array has data but array length is 0

Because it is an address reference, the actual assignment is not successful, and the assigned array has been modified. Because the original length is 0, the array cannot be obtained, but it also contains the modified result.

I use axios to request the data, and the data cannot be obtained like this:

Then make a deep copy like I did.

  onMarkerMap(d) {
      var objString = JSON.stringify(d);
      var datas = JSON.parse(objString);
      console.log(datas,'datas');
}

Guess you like

Origin blog.csdn.net/weixin_52691965/article/details/122619728