With any television series - and it's something that is taken for granted with movies because you have the whole arc within two hours - you establish who the character is and it's a two-dimensional version, or if you're lucky, a two and a half-dimensional character. Once you establish that, you can move forward and break all the rules. Once the audience has accepted who the person is, then you can do the exact opposite. What makes it funny and interesting is doing the opposite.
Rashida Jones