Im trying to check an input files extension with JavaScript, using:
if(extension != 'jpeg, JPEG, JPG, jpg'){}
I want the statement to read logically :’if variable extension doesn’t equal jpeg, or JPEG, or..’ and so on
but this doesn’t work, how do I code this properly?
If you don’t want to use
regexyou can do something like:This will also filter file extensions like
JpEg.