Q53: What is the difference between path.join() and path.resolve()?

path.join() joins all given path segments together using platform separators. path.resolve() resolves path segments into an absolute path, treating segments as roots if prefixed with /.

Key Takeaways
  • path.join() concatenates path segments normalized.
  • path.resolve() constructs absolute paths working right-to-left.
Knowledge Check

Which path method always returns an absolute path string?