Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function konamiCode () {
- var keys = [];
- var valid = _.map("38384040373937396665".match(/.{1,2}/g), _.parseInt);
- document.onkeydown = function (key) {
- if (key > 10) {
- document.onkeydown = null;
- return;
- }
- keys.push(key.which);
- if (keys.length == 10 && JSON.stringify(keys) === JSON.stringify(valid)) {
- // Code Success, do something...
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement