JavaScript doesn't have declarative syntax like in C. there is no all let's make this a variable an integer or this variable something else, whereas C does so. C++ also has classes and operator overloading whereas Javascript does not.
It seems to me C++ should be the soirce and JS sometimes the target. Although sometimes reading erors related to templates can be like reading Greek.
RE: EOS - Example Exchange Contract and Benefits of C++