I have a bunch of HTML fragments in an array (thank you query()) but I only want to use the first five. I'm using foreach
to inject the fragments into a page.
If my array was [0,1,2,3,4,5,6,7,8] I would want just [0,1,2,3,4]. In Python I would use A[:5].
How can I select the first few elements of an array and ignore the rest?