decpkdecpk.hashnode.dev·Mar 18, 2024How to type an error in try-catch blockTL;DR: TypeScript catch clause variables can now be typed as unknown for better type safety since version 4.0.Try-catch blocks are used to handle exceptions. Before TypeScript 4.0, the catch clause variable was typed as any, which meant it could be a...97 readsJavaScriptAdd a thoughtful commentNo comments yetBe the first to start the conversation.