1

A vendor I use packages their software with AssemblyScript. They provide some infrastructure and I build on top of it.

Accidentally, I changed my double equal signs ("==") to triple equal signs ("===") in a function that performs equality checks on hexadecimal strings. I spent hours ensuring that the values checked are indeed equal and have the same case sensitivity, but nothing could make the if statement enter the branch I was expecting it to enter, except for going back to "==".

And so I ended up here, asking for help. How is "===" different to "==" in AssemblyScript? Is it some quirk of the language itself or the vendor's parser?

Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114

1 Answers1

1

Yes. In AssemblyScript tripple equal ("===") compare raw references and skip overloading operator ("=="). See docs.

There are have proposal avoid this non-standard for TypeScript behaviour. You could check and upvote this issue

MaxGraey
  • 351
  • 2
  • 6