Only enter the pit, Xiao Bai
path.join('foo/', 'baz/', '../bar'); // => "foo/bar"
Why do you ignore Baz /?
It’s the same level after Baz / up level, so the default use is later.
path.dirname('/foo/bar/baz/asdf/quux');// Returns: '/foo/bar/baz/asdf'
Why do you ignore quux? Is the default quux file?
path.join('foo/', 'baz/', '../bar') The result of direct stitching is
foo/baz/../bar，After the reduction is
foo/bar，The same position is pointed before and after the reduction, but obviously this is more succinct.
path.dirname The last section of the path is removed directly, and the document mentions that if it ends with a directory separator, the separator is ignored.