TypeScript में प्रकार एनोटेशन की कमी के कारण "this" अंतर्निहित रूप से "any" प्रकार का है
नमस्ते! मैंने TypeScript सीखना शुरू किया है और एक ऐसी error का सामना किया है जिसे मैं ठीक नहीं कर पा रहा हूँ। मेरे पास एक सरल class है जो tasks की सूची प्रबंधित करती है:\n\n```typescript\nclass TaskList {\n tasks: string[] = [];\n\n addTask(task: string) {\n this.tasks.push(task);\n console.log(`Added: ${task}`);\n }\n\n printTasks() {\n this.tasks.forEach(function(task) {\n console.log(`${task} - added by ${this.name}`);\n });\n }\n}\n\nconst myList = new TaskList();\nmyList.addTask("Learn TypeScript");\nmyList.printTasks();\n```\n\nजब मैं इस code को compile करता हूँ, तो मुझे यह error मिलती है:\n\n```\n'this' implicitly has type 'any' because it does not have a type annotation\n```\n\nError `forEach` method के अंदर `console.log(`${task} - added by ${this.name}`);` लाइन पर इंगित करती है। मैं समझता हूँ कि t