判断变量是否为数组的两种方式

方式1:

a instanceof Array

方式2:

Array.isArray([1,2,3])

猜你喜欢

转载自blog.csdn.net/qq_38499019/article/details/121620483