/** @format */

export function checkType(o: any, type: string) {
  return Object.prototype.toString.call(o) === '[object ' + (type || 'Object') + ']'
}

export function jj(arr: any[], arr1: any[]) {
  return [...new Set(arr.filter(v => arr1.indexOf(v) !== -1))]
}

export function random(n: number, m: number) {
  const c = m - n + 1
  return Math.floor(Math.random() * c + n)
}
