structEvery

This function calls a given closure/function with every element in a given struct and returns true, if all of the closure calls returns true

structEvery(struct, closure [, parallel] [, maxThreads]) → returns boolean

Member Function Syntax

struct.every(closure [, parallel] [, maxThreads])

Argument Reference

struct struct
Required

closure function
Required

parallel boolean

maxThreads numeric
Default: 20

Links more information about structEvery

Examples
Sample code invoking the structEvery function

Here we have simple example about structevery function. It is supported only in Lucee.

var struct = {"Name":"Dhar","Age":"20","Country":"US"};
structevery(struct,function(key,value){
	writeOutput(key & ":" & value & " ");
	return true;
});

Expected Result: Country:US Name:Dhar Age:20

Here we have simple example about structevery member function. It is supported only in Lucee.

var struct = {"Name":"Dhar","Age":"20","Country":"US"};
struct.every(function(key,value){
	writeOutput(key & ":" & value & " ");
	return false;
});

Expected Result: Country:US

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub