Let $A,B$ sets and $B$ infinite set , $\lvert A\rvert=a , \lvert B\rvert=b$ and $1<a\leq b$, and let $D=\{f \mid f:B \to A\} $. Prove that $\lvert D\rvert=2^b$.
I know that $\lvert D\rvert=\lvert A\rvert^{\lvert B\rvert}$ and there is a subset of $B$ that has the same cardinality as $A$, but how to prove $\lvert D\rvert=2^b$?