Note: the lastChildElement will return the last child of an element that is an Element-Node! That means for the lastChildElement property, if the last child of an element is in fact of type Text-Node for example, that will be ignored and instead this property will look for the last occurrence of a child that is an Element-Node. But there’s another property called lastChild and using this property will return the last child no-matter if it’s an Element-Node, Text-Node or a Comment-Node. So if you need to get the last child of an element and you don’t care if that element might be a Text-Node or a Comment-Node, then use the lastChild property instead of the lastElementChild.
The lastElementChild property is read-only and it doesn’t take any input.
The return value of this method is a reference to the last child of the target element, and this child is of type Element-Node.
Note: if the target element does not have a child, the return value of this method becomes null.