let person: [string, number];

person = ['Alice', 30];
// person = [30, "Alice"];

type Coordinate = [number, number];
const point: Coordinate = [10, 20];

function getX(coordinate: Coordinate): number {
  return coordinate[0];
}

console.log(getX(point));

type Person = [string, number, string?];
const user1: Person = ['Alice', 30];
const user2: Person = ['Bob', 42, 'Developer'];

const [name, age, role] = user2;
console.log(name, age, role);
const user = {
  name: 'Charly',
  age: 23,
  role: 'Admin',
};

const { name: tmpName, role: tmpRole } = user;
console.log('Name: ', tmpName);
console.log('Role: ', tmpRole);

// const [isActive, setIsActive] = useState(false);

// function useState(value: any) {
//   return [value, (newvalue: any) => void ];
// }

type LogEntry = [string, ...number[]];
const log: LogEntry = ['Fehlermeldung', 404, 500, 501];
