If I have a certain sequential number of items within an array (say from index 0 - 31) that I want to push to a new array, how can I do that? Basically I want some logic that says, take items with an index of 0 - 31, and push them to a new array.
I know how to get the index when I know the string value, such as this:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
let a = fruits.indexOf("Apple"); // will be 2
.., but how do I push to a new array a subset of indexed items, like from 0 - 31, as I mentioned.