往数组中用Push添加元素,打印出来length=0,数组为空?

如图_targets为数组,使用push 或者 splice方法添加元素后,
打印_targets能正常打印
打印_targets[0]为undefined
打印_targets.length为0
之后使用_targets时显示为空…
请问有遇到相同情况的吗?
有什么解决方法呢?
如图_targets为数组,使用push 或者 splice方法添加元素后,
打印_targets能正常打印
打印_targets[0]为undefined
打印_targets.length为0
之后使用_targets时显示为空…
请问有遇到相同情况的吗?
有什么解决方法呢?