`) and want to ignore whitespace, text nodes, or comments. --- ## Syntax ```javascript element.lastElementChild ``` ### Parameters * None. ### Return Value * **Type:** `Element` object (or `null`). * **Description:** Returns the last child node that is an element. If the element has no child elements, it returns `null`. --- ## Key Differences: `lastElementChild` vs. `lastChild` It is easy to confuse `lastElementChild` with the `lastChild` property. Here is how they differ: * **`lastElementChild`**: Only returns the last child **element node** (ignoring text nodes, whitespace, and comment nodes). * **`lastChild`**: Returns the absolute last child **node**, which could be an element node, a text node (including line breaks and spaces), or a comment node. ### Visual Comparison Consider this HTML structure: ```html
- Apple
- Banana
- ` list:
```html
- Coffee
- Tea
- Milk
First paragraph.
Some inline text.
YouTip