Skip to content

Can't create an empty set? #3501

Open
Open
@paulcdejean

Description

@paulcdejean

Describe the Bug

In javascript you can all set() to create a new empty set.

However for some reason in js_sys the set's new function takes an initializer. This is completely different from how array works, where new takes no arguments and just returns an empty array.

Steps to Reproduce

Try and create a function that returns an empty set.

You need to initialize the set with a dummy object, then call clear() which is very silly.

Expected Behavior

You're not required to initialize new sets with a dummy value then call clear.

Actual Behavior

You have to create a set with a single value, then call clear().

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeTracking breaking changes for the next major version bump (if ever)enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions