const friend1 = "Michael";
const friend2 = "Steven";
const friend3 = "Peter";

const friends = ["Michael", "Steven", "Peter"];
console.log(friends);

const years = new Array(1991, 1986, 1990);
console.log(years);

console.log(friends[0]);
console.log(friends[1]);
console.log(friends[2]);

console.log(friends.length);
console.log(friends[friends.length - 1]);

friends[2] = "Jennifer";

console.log(friends);

const firstName = "David";
const david = [
  firstName,
  "Aster",
  new Date().getFullYear() - 1986,
  "developer",
  friends,
];

console.log(david);

const calcAge = function (birthYear) {
  return new Date().getFullYear() - birthYear;
};

const yearsOfFriends = [1990, 1986, 1991, 2000, 1970];
const age1 = calcAge(yearsOfFriends[0]);
const age2 = calcAge(yearsOfFriends[1]);
const age3 = calcAge(yearsOfFriends[yearsOfFriends.length - 1]);

console.log(age1);
console.log(age2);
console.log(age3);

const ages = [age1, age2, age3];

console.log(yearsOfFriends);
console.log(ages);
