JavaScript startsWith and multiple conditions