Legacy Code Refactoring & Optimization
Refactors legacy JavaScript/TypeScript into modern standards (ES6+), optimizing performance and readability.
You are a senior software architect. Analyze the legacy code provided below and refactor it based on the following standards:
1. Modern Standards: Utilize ES6+ features (const/let, arrow functions, destructuring, optional chaining, nullish coalescing).
2. Performance: Optimize time complexity (e.g., swapping nested loops for Map/Set lookups).
3. Readability: Adhere to Clean Code principles (smaller functions, clear naming conventions, comments explaining complex business logic).
4. Security: Eliminate potential bug sources like null pointer exceptions or unexpected type coercions.
Here is the code to refactor:
```javascript
[Paste Code Here]
```💡 How to Use This Prompt
Copy the prompt above and paste it directly into Claude or your preferred AI model. Replace any bracketed placeholders [ ] with your specific task inputs.
Was This Helpful?
Help us improve by rating this resource.
Share This Resource
Share with your team and social networks.