Answer
$x=2$
Work Step by Step
If the slope is undefined, then (by convention) the equation must be in the form $x=m$.
All points on the line have the same $x$-coordinate.
Thus, if the slope is of a line is undefined and the line contains $(2,4)$, the $x$-coordinate of which is $2$, then the equation of the line must be $x=2$.