console.log() is of great help for debugging Javascript code .But writing them is time consuming. You can save time by following these two tricks:
The difference between firstChild and firstElementChild can sometimes be confusing.firstChild considers both text and comment between html tags as child whereas firstElementChild does not.