join()与resolve()的作用都是用来拼接路径的,主要的区别是join方法生成的相对路径,resolve方法生成的是绝对路径
const path=require("path")
console.log(path.join('./a','./b')); //a\b
console.log(path.resolve('./a','./b')); //C:\Users\19144\Desktop\09day\09day\abc\a\b
join()与resolve()的作用都是用来拼接路径的,主要的区别是join方法生成的相对路径,resolve方法生成的是绝对路径
const path=require("path")
console.log(path.join('./a','./b')); //a\b
console.log(path.resolve('./a','./b')); //C:\Users\19144\Desktop\09day\09day\abc\a\b