get-class.js 340 B

123456789101112
  1. "use strict";
  2. var o = Object.prototype;
  3. function getClass(value) {
  4. // Returns the internal [[Class]] by calling Object.prototype.toString
  5. // with the provided value as this. Return value is a string, naming the
  6. // internal class, e.g. "Array"
  7. return o.toString.call(value).split(/[ \]]/)[1];
  8. }
  9. module.exports = getClass;