function populateInfo(person) {
  let oneCard = {}; // new object to store the required info for a person
  oneCard.name = person.name.first.charAt(0).toUpperCase()
    + person.name.first.slice(1)
    + " "
    + person.name.last.charAt(0).toUpperCase()
    + person.name.last.slice(1);
  oneCard.email = person.email;
  oneCard.location = person.location.city.charAt(0).toUpperCase()
    + person.location.city.slice(1);
  oneCard.photo = person.picture.large;
  oneCard.phone = person.phone;
  oneCard.address = person.location.street
    + ", "
    + oneCard.location
    + ", "
    + person.location.state.charAt(0).toUpperCase()
    + person.location.state.slice(1);
  const dob = person.dob.date;
  oneCard.birthday = "Birthday: "
    + dob.slice(8, 10)
    + "/"
    + dob.slice(5, 7)
    + "/"
    + dob.slice(0, 4);
  return oneCard;
}
// function to get the required info from a person object and store it in a new object
function to get the required info from a person object and store it in a new object
function to get the required info from a person object and store it in a new object
function populateInfo(person) {
  let oneCard = {}; 
  oneCard.name = person.name.first.charAt(0).toUpperCase()
    + person.name.first.slice(1)
    + " "
    + person.name.last.charAt(0).toUpperCase()
    + person.name.last.slice(1);
  oneCard.email = person.email;
  oneCard.location = person.location.city.charAt(0).toUpperCase()
    + person.location.city.slice(1);
  oneCard.photo = person.picture.large;
  oneCard.phone = person.phone;
  oneCard.address = person.location.street
    + ", "
    + oneCard.location
    + ", "
    + person.location.state.charAt(0).toUpperCase()
    + person.location.state.slice(1);
  const dob = person.dob.date;
  oneCard.birthday = "Birthday: "
    + dob.slice(8, 10)
    + "/"
    + dob.slice(5, 7)
    + "/"
    + dob.slice(0, 4);
  return oneCard;
}
function populateInfo ( person ) { let oneCard = { } ; oneCard . name = person . name . first . charAt ( 0 ) . toUpperCase ( ) + person . name . first . slice ( 1 ) + " " + person . name . last . charAt ( 0 ) . toUpperCase ( ) + person . name . last . slice ( 1 ) ; oneCard . email = person . email ; oneCard . location = person . location . city . charAt ( 0 ) . toUpperCase ( ) + person . location . city . slice ( 1 ) ; oneCard . photo = person . picture . large ; oneCard . phone = person . phone ; oneCard . address = person . location . street + ", " + oneCard . location + ", " + person . location . state . charAt ( 0 ) . toUpperCase ( ) + person . location . state . slice ( 1 ) ; const dob = person . dob . date ; oneCard . birthday = "Birthday: " + dob . slice ( 8 , 10 ) + "/" + dob . slice ( 5 , 7 ) + "/" + dob . slice ( 0 , 4 ) ; return oneCard ; }
function to get the required info from a person object and store it in a new object
function to get the required info from a person object and store it in a new object
// new object to store the required info for a person