我刚创建了index.html文件,内容如下:
<script type="text/javascript">
var markers = [{'dist': 1}, {'dist': 2}, {'dist': 3}];
console.log(markers);
</script>
当控制台打开时(按F12并选择“控制台”),然后尝试多次刷新页面。输出应该与内部没有动态内容相同,但不是。
Usualy我看到了这一点:
File: test.html, Line: 1, Column: 1
[object Object],[object Object],[object Object]
[
0: {
[functions]: ,
__proto__: { },
dist: 1
},
1: {
[functions]: ,
__proto__: { },
dist: 2
},
2: {
[functions]: ,
__proto__: { },
dist: 3
},
length: 3
]
但有时会这样:
File: test.html, Line: 1, Column: 1
[object Object],[object Object],[object Object]
[
0: {
undefined: undefined
},
1: {
undefined: undefined
},
2: {
undefined: undefined
},
length: 3
]
如果有人能对此有所了解,请提前致谢。