Advertisement
Guest User

Untitled

a guest
Sep 15th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. function isArrayLike(arg) {
  2. var buffer, length, type;
  3. return arg && (
  4. isArray(arg) || (
  5. hasToStringTag ? (
  6. typeof arg === "object" &&
  7. hasOwnProperty.call(arg, "length") &&
  8. typeof (length = arg.length) === "number" && (
  9. length === 0 || (
  10. length >= 1 &&
  11. length <= 0x20000000000000 &&
  12. floor(length) === length &&
  13. (length - 1) in arg
  14. )
  15. ) && (
  16. typeof arg.callee === "function" || (
  17. (buffer = arg.buffer) &&
  18. typeof buffer === "object" &&
  19. typeof buffer.byteLength === "number"
  20. )
  21. )
  22. ) : (
  23. (type = objectTypeOf(arg)) === "Arguments" ||
  24. sSlice.call(type, -5) === "Array"
  25. )
  26. )
  27. );
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement