I've come across an example that I can't understand. Can somebody explain what is happening here?

$\displaystyle 2^{2^{1234}} \mod 3$

So, I get that if I can get the base to be something that is equal to 1 (mod 3), then I know that the overall answer is also 1 mod 3. What I don't understand is the simplification that is used.

The example just shows one more step before jumping to the final answer. Here is what it shows:

$\displaystyle 2^{2^{1234}} \equiv (2 \times 2) ^ {2 ^ {1233}} \equiv 1 \mod 3 $

I can see that they got the base to be 4, which is 1 (mod 3), but I just can't follow the math for how they were able to make this leap. Can anybody tell me the exponentiation rule used?

Thank you!