Extracting First, Last & Middle Name from a full name My function takes a string of Name and returns First Name, Last Name and Middle Name as output.

Please review and help me optimize it.  

    //input --&gt; Hamza Khan
    ProcessFullName(full_name): Object {
        var Obj = {
            FirstName: "",
            LastName: "",
            MiddleName: ""
        };
        var splitName = full_name.split(" ");
        if (splitName.length&gt;0) {
            switch (splitName.length) {
                case 1:
                    Obj.FirstName = splitName[0];
                    break;
                case 2: 
                    Obj.FirstName = splitName[0];
                    Obj.LastName = splitName[1];
                    break;
                case 3: 
                    Obj.FirstName = splitName[0];
                    Obj.MiddleName = splitName[1];
                    Obj.LastName = splitName[2]; 
                    break;
            }
        }
        return Obj;
    } //Output --&gt; { FirstName: "Hamza", LastName: "Khan", MiddleName: "" }
Provide a type for your full_name argument and a more specific type than Object for the return type:

interface SplitNameData {  // Does anybody have a better interface name?
  FirstName: string;
  MiddleName: string;
  LastName: string;
}

ProcessFullName(full_name: string): SplitNameData {
  const Obj: SplitNameData = {
    firstName: '',
    middleName: '',
    lastName: ''
  };

I think it would be cleaner to use null as a marker for non-existing names instead of the empty string even though the empty is probably not a valid name anywhere in the world.
What is your function supposed to do with names having more than three parts?
Consider using const wherever possible and let in all other cases. I recommend to never use var. ⇒ const Obj, const splitName.
Use a more descriptive name for Obj, e.g. splitNameData or separatedNames. In this case, I would recommend to rename splitName to something like nameParts as well to avoid confusion.
Use a consistent naming scheme: fullName instead of full_name, firstName instead of FirstName and so on.
Use array destructuring:

case 2:
  [Obj.FirstName, Obj.LastName] = splitName;
  break;
case 3:
  [Obj.FirstName, Obj.MiddleName, Obj.LastName] = splitName;
  break;

ad performance: for this computationally simple task, any optimization would be premature optimization in my opinion.
Alternative (maybe cleaner?) solution using named RegExp capture groups:

const NAME_PATTERN = /^(?&lt;firstName&gt;[^ ]*) ((?&lt;middleName&gt;[^ ]*) )?(?&lt;lastName&gt;[^ ]*)$/;

const emptyNameData = {
  firstName: '', middleName: '', lastName: ''
};

const {
  groups: {
    firstName,
    middleName = '',
    lastName
  } = emptyNameData
} = NAME_PATTERN.exec(fullName) || {};
alert([firstName, middleName, lastName]);


I am not very keen on the || {} part, maybe an if-else checking the match object for null would be a better solution.