dirname issue with Node.js

What is ‘__dirname’?

The **dirname in a node script returns the path of the folder where the current JavaScript file resides. **filename and __dirname are used to get the filename and directory name of the currently executing file.

When I use express.js as a backend, I faced some issues with ‘__dirname’.

Read More

Element.classList

The Element.classList is a read-only property that returns a live DOMTokenList collection of the class attributes of the element. This can then be used to manipulate the class list.

Using classList is a convenient alternative to accessing an element’s list of classes as a space-delimited string via element.className.

Read More