What is the function of the noun clause

What I saw in the closet left me speechless

When I was six I learned how to swim

I was caught between what my conscience was telling me and what I wanted to do

The scary movie that I watched kept me up all night