Use local variables in functions whenever referencing object property