We have $$\left|y\right|=x $$$$\Leftrightarrow y=x \text{ or } y=-x. $$ Now consider this $$y=\left|x\right| $$$$\Leftrightarrow y=x \text{ or } y=-x .$$ Hence $$y=\left|x\right|\Leftrightarrow |y|=x.$$
That is both the equations are equivalent. But when I plot the graph of the equations I don't get the same graph:
The black curve represents $y=\left|x\right|$ and the blue one $\left|y\right|=x.$
