var justFunctionName = "function1";
This is assigning the string function1 to the variable justFunctionName.
If you were to do: console.log('justFunctionName');
you would end up with the following result:
>function1
Therefore this variable assignment is completely irrelevant for what you are hoping to achieve. Instead of just assigning a variable to a function you are assigning a variable to a variable which is assigned to a function.
Now take a look at what you are doing here:
var function1 = function () {
alert("!");
};
This is assigning a variable function1 to the function doing the alert. In this instance, think of the variable as a reference to the function. In order to have the button trigger the alert, you need to call the reference to the function (in this case function1):
$("#button1").click(function1);