TypeScript - 函式的型別
在 JavaScript 中,有兩種常見的定義函式的方式——函式宣告(Function Declaration)和函式表達式(Function Expression):
// 函式宣告式(Function Declaration)
function add(x, y) {
return x + y;
}
// 函式表達式(Function Expression)
const add = function (x, y) {
return x + y;
};
一個函式包含了輸入與...
yachuh.hashnode.dev4 min read