# Object Types
- Ex -
Array<T>, Map<K, V>, Set<T>, and Promise<T>
|
|
# undefined
// avoid undefined for optional property
// default value -> y = 0
interface fooInterface {
x: number;
y?: number;
}
function foo({x, y = 0}: fooInterface) {
return x + y;
}
# Readonly
interface xInterface {
readonly x: number;
}
function foo(obj: fooInterface) {
obj.x = 34; // error
}
# Extending
|
|
# Generic
|
|