In this recipe, you created a UI Slider GameObject and set it to contain whole numbers in the range of 0 to 20.
You also added an instance of the SliderValueToText C# script class to the UI Text GameObject.
The Awake() method caches references to the Text component in the textSliderValue variable.
The Start() method invokes the ShowSliderValue() method so that the display is correct when the scene begins (that is, the initial slider value is displayed).
The ShowSliderValue() method gets the value of the slider and then updates the text that's displayed to be a message in the form of Slider value = <n>.
Finally, you added the ShowSliderValue() method of the SliderValueToText scripted component to the Slider GameObject's list of On Value Changed event listeners. So, each time the slider value changes, it sends a message to call the ShowSliderValue() method so that the new value is updated on the screen.