delphidabbler/code-snippets

Add Javascript-like array methods to `TArrayUtils`

Closed this issue · 3 comments

In a comment on issue #8 it was suggested that it maybe a good idea to add some JavaScript-style array methods to TArrayUtils, specifically forEach(), some(), all()every() & map(). To those we can add reduce() (& reduceRight()?).

In this comment on issue #40 implementations were proposed for TArrayUtils' Some<T>() and Every<T>().

The JavaScript array methods are documented here.

I've been adding lots of methods to TArrayUtils on my local machine. So many that the thing is getting a bit too big for a code snippet.

So I'm thinking it would probably be better to leave the TArrayUtils snippet as-is and to move the expanded code into a new repo within the DelphiDabbler Code Library.

Not implementing this since an extended version of TArrayUtils has been released as a DelphiDabbler Code Library project: see ddablib/arrayutils