having problem with :not() Syntax

having problem with :not() Syntax

hello, i want to invert the .hasClass in line 2. 
I tried to use the :not() seperator but i can figure out the correct syntax.
any help please?
  1. $('ul#portfolio li').each(function() {
  2. if(!$(this).hasClass(filterVal)) {
  3. $(this).fadeTo("fast", 0.1).addClass('hidden');
  4. } else {
  5. $(this).fadeTo("fast", 1).removeClass('hidden');
  6. }
  7. });