Code Problem with Character Movement

So the script im using works but the problem is i don’t have the skill to make it were it can not do a 360 spin vertical. What I mean is when i look all the way up it looks up but if i push my mouse forwards i can look backwards. I want to make it were it stops at a certain point how but I don’t know how to or in correct terms have the skills.

FirstPersonMovement.prototype._onMouseMove = function (e) {
    // If pointer is disabled
    // If the left mouse button is down update the camera from mouse movement
    if (pc.Mouse.isPointerLocked() || e.buttons[0]) {
        this.eulers.x -= this.lookSpeed * e.dx;
        this.eulers.y -= this.lookSpeed * e.dy;

This is the function that gets called when you move the mouse in the app and this.eulers represent the camera pitch and yaw rotations where it gets used in the update function:

    // update camera angle from mouse events, this.eulers.x, 0);

What you need to do is clamp the pitch angle in the _onMouseMove function so it doesn’t go beyond the limits of looking straight up and looking straight down.