Let's say I have a filename 'file1.txt' How to check if a filename has either of these extensions (jpg, txt, mp4)?
If I add 'txt' first then it returns 1 (true)
var test = 'file1.txt';
test.substring(test.lastIndexOf(".")+1) === "txt"|"jpg"|"mp4"
and if I add 'txt' in the last like this "jpg"|"mp4"|"txt"
then it returns 0.
I want to simply check that if a filename has any extension or not.