Category: TypeScript
Typescript 中的函数重载
Function Overloading 可以让同一个函数接受不同个数和类型的参数。如: TypeScript 可以自动检测到这个函数有3种重载参数,你可以任选一种。
Use “ZOD” to define the data type of response from AJAX in Typescript
Although you can use the interface to define your data schema from AJAX, but zod must be the better choice. For Example: Here is the sample code to get a response from the WordPress post endpoint.