Limit items returned via $.each

Limit items returned via $.each

Hi all,

Is there a way to limit the number of items returned within an $.each statement. I know I can use $top= in my REST call, but I need the logic to limit the number of results with an $.each statement (ex. the source data has 20 results which $.each iterates through and I need to display 3).

Thanks!

Kelly