This function calls a given callback function for every element in a given string list and returns true, if all of the calls returns true.
listEvery(list, closure [, delimiter] [, includeEmptyFields] [, multiCharacterDelimiter] [, parallel] [, maxThreads])
→ returns boolean
list.listEvery(closure [, delimiter] [, includeEmptyFields] [, multiCharacterDelimiter] [, parallel] [, maxThreads])
,
false
true
true
, all characters are considered as one delimiter; otherwise each character is a delimiter on its own.
false
20
Checks whether all items in a list are greater than 2 and outputs true because all of them fulfill the requirement.
list = '4,5,6,7';
writeOutput(listEvery(list, function(value) { return value gt 2; }));
Expected Result: true
Checks whether all items in a list are greater than 2 and outputs false because some of them do not fulfill the requirement.
list = '1,2,3,4';
writeOutput(listEvery(list, function(value) { return value gt 2; }));
Expected Result: false
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.