mebtte
4/17/2019 - 5:59 AM

Get the type of vlaue.

/**
 * Get the type of value.
 * @author mebtte<mebtte@gmail.com>
 * @param {Any} [value] value
 * @return {String} enum(Undefined, Null, Boolean, Number, String, Symbol, Object, Function, Array, Set, WeakSet, Map, WeakMap, NodeList)
*/
function typeOf(value) {
  return Object.prototype.toString.call(value).match(/\[object (\S*)\]/)[1];
}