Hi
In C# code, you can loop the record this way
foreach(var entity in entityCollection.Entities)
{
//your code logics here
}
In JavaScript, you can still loop your record, though you will need to convert the returned result in a JSON object to make your life a bit easier.
Regards,
Jaimie