js如何判断传入的是数组还是对象

let objClone = Array.isArray(obj) ? [] : {};

おすすめ

転載: blog.csdn.net/liulang68/article/details/121271896