Skip to content
Related Articles

Related Articles

Web technologies Questions | Node.js Quiz | Set-3 | Question 3

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 30 Sep, 2021

How do we get the filename portion of a path to the file in Node.js ?
(A) path.extname()
(B) path.basename()
(C) path.dirname()
(D) path.delimiter


Answer: (B)

Explanation: The path.basename() method in node.js is used to get the filename portion of a path to the file. This directory was ignored when using this method. It takes a two-parameter as path and extension.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!