GUI.TextField int?

Is there a way to pass GUI.TextField an int instead of a string? I need the user to be able to enter in a number into a text field, then the script passes that number to an array to get the corresponding item in the array. I’m using JavaScript.

Still pass it a string, just parse that string to an integer. This answer explains parsing a string to int. You will probably need to do some extra work to make sure the user can only enter numbers and that the number given exists in the array.