Sha256: c54880a99ed2859ad2a5aa122230e7a552c3e50efd13317836a6b680c51773b7

Contents?: true

Size: 517 Bytes

Versions: 7

Compression:

Stored size: 517 Bytes

Contents

define(['../function/makeIterator_'], function (makeIterator) {

    /**
     * Returns the index of the last item that matches criteria
     */
    function findLastIndex(arr, iterator, thisObj){
        iterator = makeIterator(iterator, thisObj);
        if (arr == null) {
            return -1;
        }

        var n = arr.length;
        while (n-- >= 0) {
            if (iterator(arr[n], n, arr)) {
                return n;
            }
        }

        return -1;
    }

    return findLastIndex;

});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/findLastIndex.js