const person1 = { name: 'Mark', age: 39 };
const person2 = Object.create({ name: 'Mark', age: 39 });
object
- a type that represents the non-primitive type
- “primitive type 이 아닌 것” 을 나타내고 싶을 때 사용하는 타입
non-primitive type
- not number, string, boolean, bigint, symbol, null, or undefined.
let obj: object = {};
obj = { name: "Mark" };
obj = [{ name: "Mark" }];
obj = 39;
obj = 'Mark';
obj = true;
obj = 100n;
obj = Symbol();
obj = null;
obj = undefined;
declare function create(o: object | null): void;
create({ prop: 0 });
create(null);
create(42);
create("string");
create(false);
create(undefined);
Object.create(0);