tracker issue : CF-4032723

select a category, or use search below
(searches all categories and all time range)
Title:

Add .some() and .every() iteration methods

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 08/06/2015

Components: Language

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final / CF2018U5

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 9

I thought I'd already raised this, but apparently not.

Lucee has .some() and .every() iteration methods.

ColdFusion ought to have them too.

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/every

Needed for arrays, structs, lists, queries, strings (as with all the iteration methods, for strings).

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4032723

External Customer Info:
External Company:  
External Customer Name: Adam
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

+1 ...............................
Vote by External U.
6346 | August 06, 2015 04:36:29 PM GMT
+1.......................
Vote by External U.
6347 | August 06, 2015 05:25:51 PM GMT
yes, good stuff!....................
Vote by External U.
6348 | September 30, 2015 06:01:13 PM GMT
+1 ......................
Vote by External U.
6349 | October 03, 2015 08:38:10 PM GMT
I use some and every quite a bit in Clojure. I haven't yet used them in Lucee but I think this would be excellent low-hanging fruit for Adobe to add, to show they care about the _language_ and making it better.
Vote by External U.
6350 | December 23, 2015 12:08:40 PM GMT
Please explain in 25 characters or more how this feature impacts productivity and why you are adding a vote.
Vote by External U.
6351 | December 23, 2015 05:01:00 PM GMT
good extension to existing iterators, the more there are the more likely they will be used
Vote by External U.
6352 | January 19, 2016 09:41:32 AM GMT
Can you please confirm in what version of ColdFusion this is going to be implemented in. It says "to fix" but does not say which version.
Comment by External U.
6345 | January 25, 2016 08:16:46 AM GMT
+1, especially for .some(). I like a fast-fail option that doesn't require the entire object to be iterated. And I also agree w/ .every() as it clearly declares intent (more than .filter()), when simply needing to know if a condition is met on each iteration.
Vote by Aaron N.
27583 | April 26, 2018 08:32:34 AM GMT