Node.js · Junior · Question 45 of 75

How is path.resolve() different from path.join()?

Explanation

path.resolve("a", "b") gives something like /home/me/project/a/b. A segment starting with / resets the result to the root.

Further reading

Problem with a question

Node.js · Junior · question 45

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