Skip to content

Instantly share code, notes, and snippets.

@benmills
Created January 13, 2010 23:27
Show Gist options
  • Save benmills/276683 to your computer and use it in GitHub Desktop.
Save benmills/276683 to your computer and use it in GitHub Desktop.
public function arrayContains(target:*, a:Array):Boolean {
var doesNotContain:Boolean = false;
return a.some(function(e:*, i:int, ar:Array):Boolean {
var contains:Boolean = false;
if (target is Array) {
for(var ii:String in target) if (!arrayContains(target[ii], a)) doesNotContain = true;
contains = doesNotContain? false:true;
} else contains = (e == target);
return contains;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment