Function isType

  • @description: 精准判断数据类型 @author: wuxh @Date: 2020-05-06 13:51:50

    Parameters

    • data: any
    • type: string

      'String' | 'Number' | 'Boolean' | 'Undefined' | 'Null' | 'Function' | 'Date' | 'Array' | 'RegExp' | 'Error' | 'Object' @return: Boolean @example: isType(123, 'String') => false isType('123', 'String') => true

    Returns boolean