index.js
function enumerate(collection) {
    if (isObject(collection)) {
        if (collection instanceof Map) {
            return enumerateMap(collection)
        } else if (isIterable(collection)) {
            return enumerateIterable(collection)
        } else {
            return enumerateObject(collection)
        }
    } else {
        throw new TypeError("Object cannot be enumerated")
    }
}
function enumerate(collection) {
    if (isObject(collection)) {
        if (collection instanceof Map) {
            return enumerateMap(collection)
        } else if (isIterable(collection)) {
            return enumerateIterable(collection)
        } else {
            return enumerateObject(collection)
        }
    } else {
        throw new TypeError("Object cannot be enumerated")
    }
}
function enumerate ( collection ) { if ( isObject ( collection ) ) { if ( collection instanceof Map ) { return enumerateMap ( collection ) } else if ( isIterable ( collection ) ) { return enumerateIterable ( collection ) } else { return enumerateObject ( collection ) } } else { throw new TypeError ( "Object cannot be enumerated" ) } }
Inspired by Python's enumerate
Inspired by Python s enumerate