How can I retrieve a value when selecting an element from an array that doesn't have an index?
For instance:
var series = [{data: [10]}, {data: []}, {data: []}, {data: []}, {data: [10]}, {data: []}, {data: [10]},
{data: []}, {data: []}, {data: []}, {data: [10]},{data: []}, {data: []},{data: []}, {data: []},
{data: [10]},{data: []},{data: []},{data: []},{data: [10]},{data: []}, {data: []}, {data: []}]
var x = series[44].data || null;
console.log(x)
I am still getting an error. Is my use of || null
incorrect in this context?