is-implemented.js 401 B

1234567891011121314
  1. 'use strict';
  2. module.exports = function () {
  3. var arr = [1, 'foo'], iterator, result;
  4. if (typeof arr.keys !== 'function') return false;
  5. iterator = arr.keys();
  6. if (!iterator) return false;
  7. if (typeof iterator.next !== 'function') return false;
  8. result = iterator.next();
  9. if (!result) return false;
  10. if (result.value !== 0) return false;
  11. if (result.done !== false) return false;
  12. return true;
  13. };