How to Initilaze Slider from an AudioSource's volume?

Unity’s “Add toggles and sliders”

tutorial says, set a Slider component’s default Value to the same value of an Audio Source’s volume, but I don’t like it.

Is there any way to set the Slider’s value automatically from the Audio Source?

Should I write a script just for it?

The easiest way would be like so:

using UnityEngine;
using UnityEngine.UI;

public class NewBehaviourScript : MonoBehaviour {
    public AudioSource yourAudioClip;
    public Slider volumeSlider;
    private void Awake()
    {
        volumeSlider.value = yourAudioClip.volume;
    }
}