Computer scienceBackendNode.jsCore ConceptsInternal modulesPath module

Intro to path module

Build a path

Report a typo

There's a path object that we need to create a path from. The path module is already imported. Try to write the remaining code.

Sample Input 1:

{
  root: '/',
  name: 'file',
  ext: '.txt',
}

Sample Output 1:

/file.txt
Write a program in JavaScript
const path = require('path');

const pathObj = {
root: '/',
name: 'file',
ext: '.txt',
};

const resultPath = /* write your code here */
___

Create a free account to access the full topic