I would say there isn’t a function to do that, and since the objects are just scalar/vector/matrix types they won’t have any methods/attributes that would yield that either. However, that may be because I tend to think of that kind of operation in the processing of the data, not the modeling, and Stan is mainly dedicated to the latter. So I may be wrong.
I did a quick search here and could find a somewhat old thread with a related question where the answer is “no”. So the solution would probably be to loop over the array and check for the condition on each element.