Skip to content

Console log WeakSet and WeakMap always empty #19001

@anantoghosh

Description

@anantoghosh
  • Version: 8.9.4
  • Platform: Windows 10 x64
  • Subsystem: powershell

Currently trying to console.log WeakSet or WeakMap will always display as empty.

var set = new WeakSet([{yes: true}]);
console.log(set); // logs WeakSet{}

var map = new WeakMap([[{yes: true}, true]]);
console.log(map); // logs WeakMap{}

I believe I understand why logging them does not work, but node should display a warning and/or should document this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions