check if object is not instance of class in javascript