Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如果决定使用 TypeScript 而不是 JavaScript 来编写 Express.js 应用程序或 API 会有什么缺点。
我能想到的唯一客观的、非基于意见的缺点是,您必须先编译 TypeScript,然后再将其与 Node.js 一起使用,这会使事情(稍微)复杂化——使用工具链中的编译器,使用源映射来理解实际代码中发生生产错误的地方,等等。
TypeScript 将自身转换为 JavaScript。因此,除非您绝对需要 typescript,否则您可以继续编写 JS。
因此,为什么要在编译时为编译而头疼并增加您的开发工作量。