The ESLint static code analysis tool flags code where we operate on objects which can be undefined.
Object is possibly ‘undefined’
![](https://pinter.org/wp-content/uploads/2023/06/2023-06-14_17-53-40.png)
The end of the red line shows the extent of the object which can be undefined, as the “children” element is defined as optional in the type definition:
![](https://pinter.org/wp-content/uploads/2023/06/2023-06-14_17-56-37.png)
To satisfy the linter, we need to add another question mark after “children” to guard against undefined values.
hashTable[parent]?.children?.push(hashTable[element.id]);