// 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