A blog on PHP, JavaScript and more Amit Merchant · July 24, 2020 · ⋆ JavaScript The easter egg is nothing but a sequence of different keypress known as Konami Code (↑↑↓↓←→←→BA), which when achieved, can invoke this control panel at the bottom of the page.
I found this so cool and I was tempted to implement something like this on my blog as well.
For this, we’re splicing off the array from the reverse to the length of the Konami code with the following code like so.
All we need to do is convert both keySequence and konamiCode to string and compare both to invoke the easter egg like so.