If I understand correctly you are looking to get a non-repeating random name. We can try something where we remove the selected name from the array each call. If we run out of names we reset the collection from the original template.
var NameArrayTemplate : String[] = ["apple","kite","knife","man","rat","name"];
// Using Unity JS Lists
var NameArray : List.<String> = new List.<String>(NameArrayTemplate);
function chooseAName() : String{
var index = Random.Range(0, NameArray.Count);
chosenName = NameArray[index];
NameArray.RemoveAt(index);
if (NameArray.Count == 0)
NameArray.AddRange(NameArrayTemplate);
return chosenName;
}
The typical solution is to first shuffle the array (randomly swap elements for some number of iterations) in Start(). Then you select them in order until the list is empty. Alternately you can put your strings in a generic list and remove the string from the list as it is selected.