const [a, b] = ["x", "y"];
const {x, y} = {x: 1, y: 2};
const arr = [1, 2, ...[3, 4]];
const obj = { a: 1, ...{b: 2} };
const msg = `Value: ${value}`;
user?.profile?.name;
const val = input ?? "default";
const result = data || [];
const callback = fn || noop;
class Person {
constructor(name) {
this.name = name;
}
greet() {
return `Hi, I'm ${this.name}`;
}
}