I am working on a project in VS built with react (I'm new to react) and I have a loop function that returns json data and I am trying to create a list/array - [1, 2, 3, 4]
using the IDs from the loop -
for (const data of data.dataset) {
ID = data.id;
}
How can I achieve this?