Function: is

is(val, type): boolean

判断类型的 is 函数

Parameters

Name Type Description
val unknown 要判断的值
type string 类型字符串

Returns

boolean

是否为指定类型

Example

is([], 'Array'); // => true
is({}, 'Object'); // => true
is('', 'String'); // => true
ON THIS PAGE