«هذا» can function as subject or object according to its syntactic position.

Demonstratives — forms, syntax and usage