The only kind of lines which have no slope are vertical lines.
They do not have slopes, but they do have equations. In fact
their equations are very simple.
Let's plot that point and draw the vertical line through it:
Let's look at some more points on that vertical line
What do you notice about all those points? You notice that they
all have the same x-coordinate, which is -2. So the equation is
"the line every point of which has the same x-coordinate = -2"
or writing that sentence much shorter, we have
x = -2
That is the equation of that vertical line. You just write
what x (the x-coordinate) is always equal to on that line.
Edwin