Computer scienceBackendNode.jsCore ConceptsInternal modulesPath module

Intro to path module

Get property

Report a typo

Get the dir property using one of the path methods.

Sample Input 1:

user/folders/work/agreement.pdf

Sample Output 1:

user/folders/work
Write a program in JavaScript
const path = require('path');

const fullPath = 'user/folders/work/agreement.pdf';

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

Create a free account to access the full topic