NEW CPArray -arrayByApplyingBlock:(Function/*element, index*/)aBlock

Test for CPArray -arrayByApplyingBlock:
This commit is contained in:
cacaodev committed 2016-01-14 21:57:57 +01:00
1 parent 8403e36d4d
commit 08aa591c65
3 files changed
+45 -1

No files matched your search

+15
View File
@@ -880,6 +880,21 @@ Returns a hash for the object. Unlike Cocoa, the hash value does not take conten
return join.call([self _javaScriptArrayCopy], aString);
}
/* @ignore */
- (CPArray)arrayByApplyingBlock:(Function/*element, index*/)aFunction
{
var result = [],
count = [self count];
for (var idx = 0; idx < count; idx++)
{
var obj = aFunction([self objectAtIndex:idx], idx);
[result addObject:obj];
}
return result;
}
// Creating a description of the array
/*!