Only last name will appear in command bar i.e. this setName _myNameArray will display _myNameArray select 2.
If setName is used with a string e.g this setName "blah", nothing occurs in the command bar and the default randomized name is displayed.
Dealing with the units' names in a script, _x (in a forEach units _group, for example) will return the "object" as B ALFA 4-1:2 or the name written in ai unit name field in editor (if exists).
This context is rather a "variable name" for each object (ai) than an "identity name" as given via the setName command.