Very basic syntax question

button1.onRelease=function(){
loadVariables(“Text1.txt”,"_root");
}

Why do we put =fucntion after the onRelease? is it creating a function or calling one?
Am a beginner so i maybe just mixing 2 different ways of writing the same thing.

Thanks guys.