Created
April 22, 2014 14:21
-
-
Save paulakreuger/11181099 to your computer and use it in GitHub Desktop.
Check if array contains variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ==CHECK IF ARRAY CONTAINS VARIABLE | |
-----------------------------------------------------*/ | |
function oc(a) { | |
var o = {}; | |
for(var i=0;i<a.length;i++){ | |
o[a[i]]=''; | |
} | |
return o; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment