Struggling with switching Arduino and Random numbers

I don't understand this:

  inputState = random(0,10);
 inputState = digitalRead(2);

What is the point of assigning inputState a random number and then assigning it a value based on a switch state?

One should go.