Skip to content

Add $.fn.closestChildren to keep things DRY #2

@mathiasbynens

Description

@mathiasbynens

Since this pattern is used in both prevCousins and prevNieces, it might be worthwhile to give it its own method. Something like:

$.fn.closestChildren = function() {
    return this.map( function () {
        return $( this ).children().get().reverse();
    } );
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions