Because the #x# value for both points are the same, #-2#, we know the line going through these two points is a vertical line with the equation:
#x = -2#
For each and every value of #y#, #x# is equal to #-2#.
By definition, the slope of a vertical line is undefined.
We can show this as follows:
The slope can be found by using the formula: #m = (color(red)(y_2) - color(blue)(y_1))/(color(red)(x_2) - color(blue)(x_1))#
Where #m# is the slope and (#color(blue)(x_1, y_1)#) and (#color(red)(x_2, y_2)#) are the two points on the line.
Substituting the values from the points in the problem gives:
#m = (color(red)(4) - color(blue)(-2))/(color(red)(-2) - color(blue)(-2)) = (color(red)(4) + color(blue)(2))/(color(red)(-2) + color(blue)(2)) =6/0#
We can not divide by #0# therefore the slope is undefined.