Local Variable Definition in a View File

Hi There!

Is it possible to define a local variable in a view file which can be referenced throughout the file?

eg, I want to define a list of strings:

“apple”, “banana”, “berry”

I need to reference this string several times throughout the view file. I’d like to avoid hardcoding this string multiple times in case it changes.

Can I do something like:

var fruit_list = “apple”, “banana”, “berry”

Any pointers greatly appreciated!