How to extract a certain number of objects from an array

Options

Hi everyone,


So I have an external API request which returns an array as the result/response. The array has no definite number of objects in it. However I want to create a variable (an array as well) which would extract the first 3 objects from the response of the API request. I'm using the for each loop function but it just runs through all the objects and I can't seem to find a way to just take the first 3. Any help would be appreciated. Thank you.

Comments