hasClass keeps returning false

hasClass keeps returning false

Hi guys, i'm having a slight issue with my code. 
The hasClass method seems to return false always, even if the class name matches.
Here is the js code;
  1. let classAttr = $ ( this ). hasClass ( "delete" );
    console . log (classAttr);
    if (classAttr) {
    // Do something
    } else {
    // Do something else
    }
 Your response will be appreciated. Cheers!!