📅  最后修改于: 2022-03-11 15:04:17.928000             🧑  作者: Mango
// how to check provided value is in array in javascript
const is = (type, val) => val.constructor === Array;
console.log(is(Array, [1])); // true
console.log(is(Array, 1)); // false