문자열 시그니처
interface SquareConfig {
color?: string;
width?: number;
}function createSquare(config: SquareConfig): { color: string; area: number } {
// ...
}
let squareOptions = { colour: "red", width: 100 };
let mySquare = createSquare(squareOptions);Last updated
Was this helpful?