Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var ints = [1, 2, 3]
var strings = ["a", "bb", "ccc"];
var biggerThan1 = function(x:Int) {
return x > 1;
}
var longerThan1 = function(x:String) {
return x.length > 1;
}
function array_delete_if<T>( array: Array<T>, processor: T-> Bool ):Array<T>
{
for ( item in array )
if ( processor(item) )
array.remove( item );
return array;
}
array_delete_if(ints, biggerThan1); // [ 1 ]
array_delete_if(strings, longerThan1); // [ "a" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.