Node.js · Junior · Question 46 of 75

Why use the path module instead of joining paths with + "/" +?

Explanation

Windows uses \ while Linux and macOS use /. path also helps with extensions (path.extname) and file names (path.basename).

Further reading

Problem with a question

Node.js · Junior · question 46

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz