Having trouble making a flow chart for these codes, javascript
===

im having trouble making a flow chart for this code. I'm using Google docs and any help would be great. I'm guessing its Argument->function->return->method->return?    

    var titleCase = function (aString) {
        return aString.toLowerCase().replace(/^(.)|\s(.)/g,
	    function ($1) { return $1.toUpperCase();} );
		return titleCase;
	};

For this one im assuming its: argument->method->return math->local variable->return array.

    var randomObjects = function (marines) {
		function sortRandomObjects (a,b) {
			return a.MOS - b.MOS;
		}
		var orderedObjects = (marines.sort(sortRandomObjects));
		return orderedObjects;
	};

These are for a school project and I'm console.log these out like this.

    /// Logging Title-case a String into Uppercase First Words ///
    console.log(newLib.titleCase("This is driving me crazy!!"));
and,

    /// Logging Order of Objects - Of Marines :) ///
    console.log(newLib.randomObjects([
		{ Name: "Jones",    MOS: 1371 }, 
		{ Name: "Alexander", MOS: 1300 }, 
		{ Name: "Garcia",    MOS: 1312 }
		])
	);