If what you care is correctness, you can abstract it with JS classes, int32, int64, etc.
Yes, it's true that you can implement abstractions like int32, int64, uint32 and uint64, and others using JavaScript tools to emulate correct numeric behavior. For example I used BigInt to bypass these js issues, it is much slower and more complex to handle, but it give you predictable behavior. However, this is not what most developers expect from a programming language when implementing algorithms. The goal is to focus on the logic itself - not to spend time fighting around language limitations and kludges, dealing with edge cases and building virtual machines just to get reliable number handling. A language should provide robust native support for such fundamental types, especially when correctness and predictability are critical.
JavaScript is quite convenient for quickly building utilities with a graphical interface that run on any machine with a web browser. However, as a programming language, it is just a piece of shit, particularly when it comes to code analysis and implementing logic that requires precise numerical computations. Its dynamic typing and loosely defined numeric behavior often make it more of an obstacle than a tool in such contexts.
However, there are currently no real alternatives that offer the same ease and portability for writing browser-based applications, so we often have to work within the limitations of what's available. This is precisely why tools like Emscripten have emerged - essentially implementing a virtual machine in JavaScript that allows code written in more robust, strongly typed languages to run in the browser while leveraging the GUI capabilities available through JavaScript.
Returning to the topic of using JavaScript on microcontrollers - it's far from an ideal choice. MCU environments lack web-browsers, and the language itself is highly resource-intensive, both in terms of runtime and memory footprint. Given the limited resources available on typical microcontrollers, JavaScript is generally unsuitable for such low-level, performance-constrained applications.
As for the challenges of porting code from other languages to JavaScript, one of the most notable issues is the lack of proper numeric formatting support. What is straightforward and reliable in other languages often becomes a source of frustration in JavaScript, requiring workarounds, kludges and unreliable hacks to achieve the same level of precision and control.