Skip to content

Object.setPrototypeOf() not best practice at page 80 and elsewhere too #30

@cuccagna

Description

@cuccagna

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf

Object.setPrototypeOf() has problems, avoid it, instead use Object.create
Replace:
Object.setPrototypeOf(TaxedProduct.prototype,Product.prototype); with
TaxedProduct.prototype = Object.create(Product.prototype)
Object.defineProperty(TaxedProduct.prototype,"constructor",{enumerable:false,value:TaxedProduct)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions