Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

This is one possible example of object-based prototypal inheritance, using hasOwnProperty to break the prototype chain.

    const _createElement = _proto => {
        let _el = Document.createElement()
        for (var prop in _proto) {
            if (Object.hasOwnProperty(prop)) {
                _el[prop] = _proto[prop]
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.