If one class exists and the other class doesn't exist

If one class exists and the other class doesn't exist

Hi,

This code should say that: if one class exists and the other class doesn't exist, do something

  1. if( $('.file').length && $('.table-striped') == 0 ) {
  2.        // Do something
  3.       }

Is there any error in the above code?

Thanks