Q:

Is there a better way to make a page redirect after input is given WITHOUT an input box?

So far, I have come up with this code... Is there a better way to do this without an input box or hitting enter/clicking things? I intend for this to be an easter egg, but it is very large, and is a bit frustrating to look at.
<!-- 7H3 F0110W1N6 R3D1R3C7S 7H3 P463 WH3N 7H3 C0RR3C7 C0D3 1S 3N73R3D -->
<!-- THE FOLLOWING REDIRECTS THE PACE WHEN THE CORRECT CODE IS ENTERED -->
<!-- THE CODE IS: UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A S -->
<script>
    document.addEventListener('keydown', function(event) {
if(event.keyCode == 38) {
        document.addEventListener('keydown', function(event) {
    if(event.keyCode == 38) {
        document.addEventListener('keydown', function(event) {
        if(event.keyCode == 40) {
            document.addEventListener('keydown', function(event) {
            if(event.keyCode == 40) {
                document.addEventListener('keydown', function(event) {
                if(event.keyCode == 37) {
                    document.addEventListener('keydown', function(event) {
                    if(event.keyCode == 39) {
                        document.addEventListener('keydown', function(event) {
                        if(event.keyCode == 37) {
                            document.addEventListener('keydown', function(event) {
                            if(event.keyCode == 39) {
                                document.addEventListener('keydown', function(event) {
                                if(event.keyCode == 66) {
                                    document.addEventListener('keydown', function(event) {
                                    if(event.keyCode == 65) {
                                        document.addEventListener('keydown', function(event) {
                                        if(event.keyCode == 83) {
                                            alert('CODE ENTERED');
                                            window.location = "NEW WEB ADRESS"
                                        }
                                    });
                                    }
                                });
                                }
                            });
                            }
                        });
                        }
                    });
                    }
                });
                }
            });
            }
        });
        }
    });
    }
});  
}
});
</script>

A:

I'm not sure if you're aware, but every time you press a key in your initial solution, you will add more and more event listeners.  This is quite unnecessary and impractical, as the same solution can be achieved with just one.
The bug in your code is you're assigning the URL to window.location instead of window.location.href.
EDIT: Assigning to window.location or window.location.href are both correct and yield the same results.

const codes = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 83];
let codeIndex = 0;

document.addEventListener("keydown", (event) => {
  console.log(event.keyCode);
  if (event.keyCode != codes[codeIndex++]) {
    codeIndex = 0; // wrong code, reset
  }
  if (codeIndex == codes.length) {
    alert("CODE ENTERED"); // success!
    // window.location.href = "NEW WEB ADDRESS";
  }
});
p {
  font-family: Arial, sans-serif;
  font-size: 1em;
  line-height: 1.25em;
}

key {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid #ccc;
  border-radius: 0.25em;
  background-color: #eee;
  font-family: monospace;
}
<p>Focus on this snippet and enter the code to trigger the alert:
  <key title="Up">&uarr;</key>
  <key title="Up">&uarr;</key>
  <key title="Down">&darr;</key>
  <key title="Down">&darr;</key>
  <key title="Left">&larr;</key>
  <key title="Right">&rarr;</key>
  <key title="Left">&larr;</key>
  <key title="Right">&rarr;</key>
  <key title="B">B</key>
  <key title="A">A</key>
  <key title="S">S</key>
</p>

