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])

structEvery 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


Fork me on GitHub