// 배열
const fruits = ["apple", "banana", "cherry"];
console.log(fruits[1]); // "banana"

// 객체
const person = {name: "John", age: 30};
console.log(person.name); // "John"
<ul>
    <li class="a">김밥</li>
    <li class="a">라면</li>
    <li class="a">떡볶이</li>
</ul>
const liElements = document.getElementsByClassName("a");
console.log(liElements); // HTMLCollection(3) [li.a, li.a, li.a]

for (const liElement of liElements) {
    console.log(liElement.textContent);
}
/*
    "김밥"
    "라면"
    "떡볶이"
*/
<ul>
    <li>김밥</li>
    <li>라면</li>
    <li>떡볶이</li>
</ul>
const liElements = document.querySelectorAll("li"); // li 선택자를 모두 선택
console.log(liElements); // NodeList(3) [li, li, li]

for (const liElement of liElements) {
    console.log(liElement.textContent);
  }
/*
    "김밥"
    "라면"
    "떡볶이"
*/