function buildPerson(fname, lname, age) {
    return {
        firstName: fname,
        lastName: lname,
        age: age,
        toString: function personToString() {
            return this.firstName + ' ' + this.lastName
        }
    };
}
/**
 * Problem 6.
 *
 * Write a function that groups an array of people by age, first or last name.
 * The function must return an associative array, with keys - the groups, and values - arrays with people in this groups
 * Use function overloading (i.e. just one function).
 * */
Problem 6.
Write a function that groups an array of people by age, first or last name.
The function must return an associative array, with keys - the groups, and values - arrays with people in this groups
Use function overloading .
Problem 6 . Write a function that groups an array of people by age first or last name . The function must return an associative array with keys - the groups and values - arrays with people in this groups Use function overloading .
function buildPerson(fname, lname, age) {
    return {
        firstName: fname,
        lastName: lname,
        age: age,
        toString: function personToString() {
            return this.firstName + ' ' + this.lastName
        }
    };
}
function buildPerson ( fname , lname , age ) { return { firstName : fname , lastName : lname , age : age , toString : function personToString ( ) { return this . firstName + ' ' + this . lastName } } ; }
Problem 6.
Problem 6 .