There are a few reasons why you might want to compare C++ compiled to WebAssembly (WASM) to JavaScript:
It's worth noting that WASM is not a replacement for JavaScript and the two languages have different strengths and use cases. In general, JavaScript is better suited for tasks that require high-level abstractions and dynamic language features, while WASM is better suited for tasks that require low-level access to system resources or demand maximum performance.
To test this we wrote a program in javascript and in C++, which loops through each bit to try to find a u32 inverse of a value you can enter.
We will transform your value into u32 type, because Javascript is working on this datatypes for bit-wise-operations.
In the end we will show you both results and the respective time it took for both programms. Have fun!!
Please note, that it might take several minutes for the process to finish (especially on mobile devices). So please be patient.