Which one would be better? (for memory and calculation speed)
new Float32Array(2);
new Float64Array(2);
{x: 0, y: 0};
[0, 0];
Obviously 1. is more memory efficient than 2, but what about speed? 32 bits calculations will be faster than 64 bits? What about the others?
Take a look at this answer.
Float32Array
s are used for WebGL apps.
Also, arrays are always faster than objects, for example that's why Elm use arrays to construct it's virtual DOM.