Other CP members already pointed it out the correct way to call the function is
fullName : cutName(myArray)
Another tip I wanted to throw in is the full name formatting, this way the function will return "Firsname, Lastname" VS "Firstname,Lastname"
return cut[0] + ', ' + cut[1];
OR, this method, you don't have the control to arrange the name.
return cut.join(", ");
Example:
cutname - JSFiddle[
^]