Sha256: 23d56c1359d190af0f10341a2f0a5548bceb0fe3ec31d30d5baae97e3adaf646

Contents?: true

Size: 709 Bytes

Versions: 69

Compression:

Stored size: 709 Bytes

Contents

define(function () {

    /**
     * Create slice of source array or array-like object
     */
    function slice(arr, start, end){
        var len = arr.length;

        if (start == null) {
            start = 0;
        } else if (start < 0) {
            start = Math.max(len + start, 0);
        } else {
            start = Math.min(start, len);
        }

        if (end == null) {
            end = len;
        } else if (end < 0) {
            end = Math.max(len + end, 0);
        } else {
            end = Math.min(end, len);
        }

        var result = [];
        while (start < end) {
            result.push(arr[start++]);
        }

        return result;
    }

    return slice;

});

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
trusty-festivity-extension-2.3.21 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.20 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.19 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.18 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.17 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.16 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.15 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.14 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.13 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.12 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.11g node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.10 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.9 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.8 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.7 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.6 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.5 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.4 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.3 node_modules/bower/node_modules/mout/src/array/slice.js
trusty-festivity-extension-2.3.2 node_modules/bower/node_modules/mout/src/array/slice.js