Skip to content

How to compare Object.create()? #620

@fundon

Description

@fundon

Using Object.create method to create object.
How to compare them for equality or deep equality?

Use Object.getPrototypeOf?

e.g.

var a = Object.create(null);
var b = Object.create({});
assert.deepEqual(a, b);

var a = Object.create({});
var b = Object.create({a:233});
assert.deepEqual(a, b);

Metadata

Metadata

Assignees

No one assigned

    Labels

    assertIssues and PRs related to the assert subsystem.

    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