Sandbox.
type Fn = (x: number) => boolean // cannot be changed const arrowFn: Fn = (x) => { return !x } // how? function normalFn: Fn (x) { return !x }
也可以将Function关键字与const一起使用:
const normalFn: Fn = function (x) { return !x; };