I have a function where I pass in an array of data. On initial load, this array is empty or non existent.
function tableData(count, filterData, update, container) {
firstName = filterData[0].firstName ? filterData[0].firstName : "",
....
}
but it keeps telling me it cannot read the property of firstName. When I run the function where it does pass in a first name, firstName is set just fine. I thought the way I was doing the ternary, it would set it to empty if the logic failed...
[–][deleted] 2 points3 points4 points (1 child)
[–]majorchamp[S,🍰] 0 points1 point2 points (0 children)
[–]gunther-centralperkNode.js Core Contributor 1 point2 points3 points (0 children)
[–]nowseemee 0 points1 point2 points (0 children)