10k-ohm resistor in chapter 2 of arduino projects book

It is called a "pull-down" resistor. When the button is not pressed it keeps the input of arduino at 0V ("down").
Otherwise, the input of the arduino will float between 0-5V randomly, or it will stay at 5V when the internal pull-up is activated (pull-up is a resistor wired from input to +5V)..