Node.js · Junior · Question 44 of 75
What does path.join("/users", "anna", "../docs", "file.txt") return on Linux?
- ✓Correct answer:
/users/docs/file.txt - 2
/users/anna/../docs/file.txt - 3
/docs/file.txt
Explanation
path.join joins the segments with the platform separator and normalizes .. and .. It does not check whether the path exists.