const fruits = ["apple", "orange", "banana"];
console.log(fruits.length); // 3

const emptyArr = [];
console.log(emptyArr.length); // 0
const greeting = "환영합니다. 반값습니다!";
console.log(greeting.length); // 13

const emptyStr = "";
console.log(emptyStr.length); // 0
function myFunction(a, b, c) {
  console.log(arguments.length);
}

myFunction(); // 0
myFunction(1); // 1
myFunction(1, 2); // 2
myFunction(1, 2, 3); // 3
const elements = document.querySelectorAll("p");
console.log(elements.length); // 요소의 개수
const numbers = [1, 2, 3, 4, 5];
const fromNumbers = Array.from(numbers);

console.log(fromNumbers.length); // 5
const obj = {
    name: "홍길동",
    age: 30,
    address: "서울특별시 서초구 사임당로 123"
};

console.log(obj.length); // undefined
const myArray = [1, 2, 3, 4, 5];

// 읽기: length 속성을 통해 배열의 길이를 확인
console.log(myArray.length); // 출력: 5

// 쓰기 시도: length 속성을 직접 수정하는 것은 불가능
myArray.length = 10; // 이 코드는 동작하지 않습니다.

// 변경 후 읽기: length 속성이 변경되지 않았음을 확인
console.log(myArray.length); // 출력: 5
const myString = "Hello, World!";

// 읽기: length 속성을 통해 문자열의 길이를 확인
console.log(myString.length); // 출력: 13

// 쓰기 시도: length 속성을 직접 수정하는 것은 불가능
myString.length = 10; // 이 코드는 동작하지 않습니다.

// 변경 후 읽기: length 속성이 변경되지 않았음을 확인
console.log(myString.length); // 출력: 13
function myFunction(a, b, c) {
  arguments.length = 10;
  console.log(arguments.length);
}

myFunction(); // 10
myFunction(1); // 10
myFunction(1, 2); // 10
myFunction(1, 2, 3); // 10