How to convert quaternion to angle?

I’m looking for a way to change the matrix4 that I have rotated and get the rotation value back. here is my code snippet.

const degree = 240;
const matrix = new THREE.Matrix4();
const rotated = matrix.makeRotationZ(degree * (Math.PI / 180));

let vec = new THREE.Quaternion();
const test2 = vec._w;
const test3 = 2 * Math.acos(test2);

const radToDegree = (test3 * 180) / Math.PI;

Everything works fine. But got strange value when I convert at an angle of more than 240 degree.