The homework question is wrong, and so is the provided answer. Exponentiation $a^b$ is well defined when either $b$ is integer (and $a$ is invertible in case $b<0$) or when $a\in\Bbb R_{>0}$; in the former case the "repeated multiplication" definition of exponentiation applies, and in the latter case the definition $a^b=\exp(b\ln a)$ where the functions $\exp:\Bbb C\to\Bbb C$ and $\ln:\Bbb R_{>0}\to\Bbb R$ are the usual well defined ones. In the case of $\def\ii{{\bf i}}\ii^{\ii}$ however neither of these cases applies, so the expression is not well defined.
Many will try to nevertheless use the formula $\exp(b\ln a)$ to give a value to$~a^b$, as is done (somewhat indirectly) in the answer presented in the question. However, this overlooks that fact that the justification for $a^b=\exp(b\ln a)$, namely $$a^b =(\exp(\ln a))^b =\exp((\ln a)b),$$ uses a rule, namely $(\exp y)^z=\exp(yz)$ (or maybe even more generally $(a^y)^z=a^{yz}$ for $a\in\Bbb R_{>0}$), that simply does not hold for all $y,z\in\Bbb C$ (although it does hold for $y\in\Bbb R$ and $z\in\Bbb C$). For a simple example where the rule fails, take $y=2\pi\ii$ and $z=\pi$, then
$$
(\exp2\pi\ii)^\pi=1^\pi=1\neq
\exp(2\pi^2\ii)\approx 0.629681725+0.77685322\ii
.
$$
An alternative form of the rule is $\ln(x^y)=y\ln(x)$ that also fails in general when $y\notin\Bbb R$, for instance when $y=2\pi\ii$ and $x=e$, where it would give $0=2\pi\ii$. Your "answer" uses this latter rule at the very beginning with $y=\ii$, which is outside of the range where the rule is valid.
See also this answer.