How to use the collect function from lodash

Find comprehensive JavaScript lodash.collect code examples handpicked from public code repositorys.

1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
    attrs = this.attrs,
    root = !this.parent,
    namespaces = this.namespaces;

function collectNsAttrs() {
    return _.collect(namespaces.used, function(ns) {
        var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
        return { name: name, value: ns.uri };
    });
}
fork icon0
star icon0
watch icon1

Other functions in lodash

Sorted by popularity

function icon

lodash.get is the most popular function in lodash (7670 examples)