JavaScript - Global Functions


 

KEYCODES

Definition of all usable Keycodes, so you can use'em the readable way when necessary:

  • TAB, ENTER, BACKSPACE, ESCAPE
  • INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN
  • CURSOR_LEFT, CURSOR_UP, CURSOR_RIGHT, CURSOR_DOWN
  • F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12
Example:

		if(e.keyCode == KEYCODES.TAB && e.shiftKey==false) {
		

 

bool = anyOf(needle,haystack)

Is the needle anywhere in the haystack?
One of our favourite JavaScript helpers. We think it's so cute, it's here to stay.