Output particles as array and directly as JS