lets assume i have data now i want to check if index is there and process the logic based on that condition, what would be correct approach using ES6 to run below conditions ?
Any better way to achieve this task ?
main.ts
data = [
{"obj1":"data"},
{"obj2": "data"},
]
if(data[0].length) {
// process logic
}
if(data[1].length) {
// process logic
}