Answers for "js get file extension and name"

16

javascript get file extension

var fileName = "myDocument.pdf";
var fileExtension = fileName.split('.').pop(); //"pdf"
Posted by: Guest on August-02-2019
0

file extension name in js

const path = require('path')

path.extname('picture.png') //.png
path.extname('picture.of.a.dog.png') //.png
path.extname('picture.of.a.dog.jpg') //.jpg
path.extname('picture.of.a.dog.jpeg') //.jpeg
Posted by: Guest on June-19-2021

Code answers related to "js get file extension and name"

Code answers related to "Javascript"

Browse Popular Code Answers by Language