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

const emptyArr = [];
console.log(emptyArr.length); // 0
const greeting = "Welcome. Nice to meet you!";
console.log(greeting.length); // 22

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); // the number of elements
let str = "Hello, World!";
console.log(str.length); // 13

// Attempt to modify the length property
str.length = 5;

console.log(str.length); // still 13
console.log(str);        // "Hello, World!" remains unchanged
let arr = ["Apple", "Banana", "Orange", "Grape"];
console.log(arr.length); // 4

// 1. Reduce the length (shorten the array)
arr.length = 2;
console.log(arr.length); // 2
console.log(arr);        // ["Apple", "Banana"] → remaining elements are permanently removed

// 2. Increase the length (expand the array)
arr.length = 5;
console.log(arr.length); // 5
console.log(arr);        // ["Apple", "Banana", empty × 3] → empty slots (holes) are created

// 3. Deleted data cannot be restored
console.log(arr[2]);     // undefined