Skip to content

Consider copyOwnFrom #1

@dotproto

Description

@dotproto

Dr. Axel has a copyOwnFrom helper function that may be useful on http://www.2ality.com/2011/12/subtyping-builtins.html.

function copyOwnFrom(target, source) {
    Object.getOwnPropertyNames(source).forEach(function(propName) {
        Object.defineProperty(target, propName, Object.getOwnPropertyDescriptor(source, propName));
    });
    return target;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions