Eh, I don’t buy that reasoning. JavaScript is excellent at encapsulation, since you can just use closures. Never had a problem manipulating quaternions in JavaScript. I’ve written a few 3D games in JavaScript or TypeScript. Some using engines like Three.js, others using bare WebGL, and some using math libraries like glMatrix, others using math routines that I wrote.
glMatrix is a fine way to work with quaternions.
http://glmatrix.net/docs/module-quat.html