A Person object represents one person through properties such as fullname, address, and birthYear. Collections of these objects make familiar data-processing operations concrete: extracting names, grouping locations, counting countries, and selecting people born in a particular year. section 3.3
Creating and reading person objects
Four objects are created with Person and Address constructors, then stored in an array. A small arrow function extracts a name: const name = p => p.fullname; console.log(name(p1)); // 'Haskell Curry'. The same collection can be mapped, reduced, or filtered using properties such as address.country and birthYear. section 3.3
const p1 = new Person('Haskell', 'Curry', '111-11-1111');
p1.address = new Address('US');
p1.birthYear = 1900;
const p2 = new Person('Barkley', 'Rosser', '222-22-2222');
p2.address = new Address('Greece');
p2.birthYear = 1907;
const p3 = new Person('John', 'von Neumann', '333-33-3333');
p3.address = new Address('Hungary');
p3.birthYear = 1903;
const p4 = new Person('Alonzo', 'Church', '444-44-4444');
p4.address = new Address('US');
p4.birthYear = 1903;
Browse the concrete Person and Address instances, including names, countries, and birth years. section 3.3
