Replit.JavaScript Object-9. 객체 안의 배열 접근

younghyun·2021년 12월 31일
0

Assignment

  • accessArray 함수를 작성해주세요.
  • 함수의 리턴값이 "pine" 이 될 수 있도록 해주세요.
function accessArray() {
  //아래의 코드는 수정하지마세요.
  let myPlants = [
    {
      type: "flowers",
      list: [
        "rose",
        "tulip",
        "dandelion"
      ]
    },
    {
      type: "trees",
      list: [
        "fir",
        "pine",
        "birch"
      ]
    }
  ];

  // 아래에 코드를 작성해주세요.
  let foundValue = myPlants[1].list[1]

  // 아래의 코드를 수정하지마세요.
  return foundValue;
}
console.log(accessArray())
module.exports = { accessArray };
profile
선명한 기억보다 흐릿한 메모

0개의 댓글