have file_name.JSON, like
[{"id": 1},{"id": 2},{"id": 3}]
How can I use "for" to get in final: 1,2,3
const file_name = [{
"id": 1
}, {
"id": 2
}, {
"id": 3
}]
for (let i = 0; i <= file_name.length; i++) {
console.log(file_name[i].id);
}
Or maybe another way, not use "for"
id of undefinederror. Are you asking about the usage of the loop or how to fetch the file?