‘out []‘ is outside the loop like a sort of function.
It will be called periodically from the thing.handle() within the loop.
So prepare (average/sort etc…) your variables in the loop.
You can also stream variables ant any pace…
thing["YourThing"] >> []( pson & out){
int value; //or float or whatever you need
//do stuff with the value and main variables, for example.
out["YourVariable"] = value;
};
And in the commented line do the operation(s) you want to do and it will run each time the value will be uploaded to the cloud or the “thing” is consulted.