how to get file extension in javascript last index
var extension = fileName.substring(fileName.lastIndexOf('.')+1);var fileName = "myDocument.pdf";
var fileExtension = fileName.split('.').pop(); //"pdf"
Also in JavaScript:
- js scroll to top
- emit resize event in angular
- javascript style inline react
- core.js:12799 Can't bind to 'ngForIn' since it isn't a known property of 'ng-container'.
- closures in javascript
- jquery iterate obj
- js replace blogger thumb
- react dropdown menu stack overflow
- embed discord.js
- js for
- slice in javascript
- javascript fuzzy search
- pi in js
- nextjs starter template with auth
- kill all node processes
- Unterminated quote at columns 0-8 ['MM-yyyy] in expression ['MM-yyyy]
- checkbox default value and checked value get in jquery
- extension for local storage in angular 8
- push a new route only triggers URL change but not location change
- how to define variable in javascript
- javascript find duplicate in array
- discord.js bad word filter
- javascript arrays codeburst
- parsley validation checkbox alignment