Skip to content

Addition of String and BigInt improperly marked as invalid in examples #43807

@Chooks22

Description

@Chooks22

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Addition#addition_using_bigints

What specific section or headline is this issue about?

Addition using BigInts

What information was incorrect, unhelpful, or incomplete?

Strings take priority over BigInts as described in the "Description" part of the page, hence it's valid and doesn't throw a TypeError at runtime.

What did you expect to see?

"1" + 2n doesn't throw a TypeError, so it shouldn't be there or should be replaced with a proper invalid example.

Do you have any supporting links, references, or citations?

In the same page. console.log("1" + 2n) also runs in the playground.

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions