Complete the code to import the path module.
const path = require('[1]');
The path module is used to work with file and directory paths in Node.js.
Complete the code to get the absolute path of 'file.txt' in the current directory.
const absolutePath = path.[1]('file.txt');
path.join which does not guarantee an absolute path.path.basename which returns only the file name.path.resolve() converts a relative path to an absolute path.
Fix the error in the code to correctly resolve the absolute path of 'data.json' inside the 'config' folder.
const configPath = path.resolve(__dirname, [1]);Paths must be strings. Using quotes around the path string is required.
Fill both blanks to create an absolute path to 'index.js' inside the 'src' folder, starting from the current directory.
const indexPath = path.[1](__dirname, [2]);
path.join which may not return an absolute path.path.resolve with __dirname and a string path returns the absolute path.
Fill all three blanks to create an absolute path to 'app.js' inside the 'lib' folder, using path.resolve and process.cwd().
const appPath = path.[1](process.[2](), [3]);
__dirname instead of process.cwd() when the current working directory is needed.process.cwd() returns the current working directory. path.resolve combines it with the relative path string to get the absolute path.