The slope of a line is the change in y divided by the change in x over any interval. For the line y=-1, y stays the same and x increases constantly, giving us the slope m=0 (0 divided by anything is 0). For the line x=-1, y increases infinitely while x does not change. However, writing this as a fraction gives us a denominator of 0, which is undefined.
So, the slope of the line y=-1 is 0, and the slope of the line x=-1 is undefined.
I have attached a screenshot of the two lines graphed on Desmos. y=-1 is highlighted in red and x=-1 is highlighted in blue.