Skip to content

Instantly share code, notes, and snippets.

@abozhilov
Created January 24, 2012 13:03
Show Gist options
  • Save abozhilov/1670090 to your computer and use it in GitHub Desktop.
Save abozhilov/1670090 to your computer and use it in GitHub Desktop.
Kik's extension check
var IMG_EXT = {
'.jpg' : 1,
'.png' : 1,
'.gif': 1,
'.jpeg' : 1
};
var ext;
if (IMG_EXT[(ext = path.slice(-5))] || IMG_EXT[ext.slice(1)]) {
//do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment