Get information from variable

Hello! My question is how can i get data out of the variable example:

If i have an var and a script that makes so when i push a button an animation plays, i normaly use Animation.Play(“Animation”); but how can i make so the code uses the name of the animation that is dragged into the variable.

Regards
Stian

var animationName = “WalkAnimation”;

Animation.Play(animationName);