Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript - How to get the extension of a filename

let filename = "index.js";
let extension = filename.split(".").pop();

console.log(extension); // "js"
Source by sebhastian.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #How #extension #filename
ADD COMMENT
Topic
Name
1+3 =