The DOM firstChild Property is used to return the firstchild Node of its parent node element. It is read-only property and may return an element node, a text node or a comment node.
Syntax:
node.firstChild
Return Value: It returns a string value which represent the first child of a node. If the element does not have a child node then it returns a null value.
The DOM lastChild property is used to return the last child of the specified node. It returns the last child nodes as text, comment, or element nodes (depend on which occurs at last). It is a read-only property.
Syntax:
node.lastChild
Return Value: It returns a node object which represents the last child of the node and null if there are no child elements.