Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Is there a reason why you makeArray twice? #1

@yckart

Description

@yckart

I've noticed that you use makeArray twice in unhook, has this a more fundamental reason?

$.unhook = function (fns) {
    fns = typeof fns === 'string' ? 
        fns.split(' ') : 
        $.makeArray(fns) // 1st makeArray
    ;

    jQuery.each( $.makeArray(fns), function (i, method) { // 2nd makeArray
        var cur = $.fn[ method ];

        if ( cur && cur.__hookold ) {               
            $.fn[ method ] = cur.__hookold;         
        }
    });
};

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