Get the dir property using one of the path methods.
Intro to path module
Get property
Report a typo
Sample Input 1:
user/folders/work/agreement.pdfSample Output 1:
user/folders/workWrite a program in JavaScript
const path = require('path');
const fullPath = 'user/folders/work/agreement.pdf';
const dir = /* write your code here */
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.