In my opinion, for task 2 it would be more appropriate to use position: fixed;, because we donβt need the sticky behavior. (The sticky behavior would be visible if there was additional text above the sidebar.)
Hello. I completely agree with you. Initially, I did just that.
But I would like to explain why I then changed it to position: sticky;. I noticed that if the <body> has vertical scrolling, then the .sidebar can go outside of the .container, so I fixed it with position: sticky; and it solved this problem. Now if the <body> gets vertical scroll, then the .sidebar still stays inside the .container. I understand that here it was deprivation, and probably this is solved by some other tools, but I was annoyed by the fact that the .sidebar can leave the .container