Skip to content

Conversation

@earlduque
Copy link
Contributor

Adding an improved version of the Konami code script with the following changes:

  1. Uses e.key instead of e.keyCode (which is deprecated) with modern arrow key names
  2. Automatically tracks only the last N keypresses instead of manual position tracking
  3. Resets the sequence if the user pauses too long (more forgiving UX)
  4. Removes event listener when widget is destroyed to prevent memory leaks
  5. Uses array join comparison instead of position tracking
  6. Modern variable declarations for better scoping

@am-shakeel am-shakeel self-requested a review September 30, 2025 16:05
@am-shakeel am-shakeel self-assigned this Sep 30, 2025
Copy link
Contributor

@am-shakeel am-shakeel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@am-shakeel am-shakeel merged commit 96a44ee into ServiceNowDevProgram:main Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants