Skip to content

[Feature] Allow comparison expressions between strings based on their codepoints like in standard JavaScript #718

@Luna-Klatzer

Description

@Luna-Klatzer

Is there an existing proposal for this?

  • I have searched the existing issues

This feature does not exist in the latest version

  • I am using the latest version

Proposal

Currently writing a comparison expression between strings causes an error, as they generally are not considered of numeric value. However, in standard JavaScript comparing strings is allowed due to the fact that they have a codepoint value corresponding to their Ascii/UTF-16 value. Using this value, comparisons can be performed and expressions like "A" < "a" are evaluated as true given their codepoints being 65 and 97 respectively.

Exact behaviour / changes you want

  • Implement support for string comparisons.

Metadata

Metadata

Assignees

Labels

featureNew feature or enhancement

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions