3 var isString = require('es5-ext/string/is-string')
4 , ArrayIterator = require('./array')
5 , StringIterator = require('./string')
6 , iterable = require('./valid-iterable')
7 , iteratorSymbol = require('es6-symbol').iterator;
9 module.exports = function (obj) {
10 if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();
11 if (isString(obj)) return new StringIterator(obj);
12 return new ArrayIterator(obj);