Tuesday, 15 July 2014

proper JavaScript 'or' syntax? -



proper JavaScript 'or' syntax? -

im trying check input files extension javascript, using:

if(extension != 'jpeg, jpeg, jpg, jpg'){}

i want statement read logically :'if variable extension doesn't equal jpeg, or jpeg, or..' , on

but doesn't work, how code properly?

if don't want utilize regex can like:

extension = extension.tolowercase(); if(extension != 'jpeg' && extension != 'jpg')

this filter file extensions jpeg.

javascript syntax

No comments:

Post a Comment