Returns whether each element in the given array is the expected type
Optional
the array to check
the expected element type
treat null as string or object
whether each element in the given array is the expected type
isTypeof(['foo', 'bar'], 'string'); // trueisTypeof(['foo', 'bar', null], 'string', true); // true Copy
isTypeof(['foo', 'bar'], 'string'); // trueisTypeof(['foo', 'bar', null], 'string', true); // true
Returns whether each element in the given array is the expected type