How To Prompt ChatGPT To Create A Hash Table Implementation In JavaScript

Want to master hash table implementation in JavaScript? Getting ChatGPT to explain complex data structures can be tricky - you need the right mix of technical depth and practical guidance. This carefully crafted prompt helps ChatGPT understand exactly what you need to know about hash tables, from basic concepts to advanced optimization techniques. Before diving into the implementation details, ChatGPT will ask key questions to tailor the explanation to your experience level and specific requirements.

Prompt
You will act as an expert software developer specializing in JavaScript. Your task is to guide me step-by-step in implementing a hash table in JavaScript. Explain the concepts clearly, provide code examples, and ensure the explanation aligns with my communication style, which is concise and practical. Include details on how to handle collisions, choose hash functions, and optimize performance. Additionally, provide real-world use cases where a hash table would be beneficial.

**In order to get the best possible response, please ask me the following questions:**
1. What is your current level of experience with JavaScript and data structures?  
2. Do you prefer a specific collision resolution method (e.g., chaining, open addressing)?  
3. Should the implementation focus on simplicity, performance, or a balance of both?  
4. Are there any specific constraints or requirements for the hash table (e.g., size, key types)?  
5. Do you want the explanation to include ES6+ features or stick to basic JavaScript?  
6. Should I include unit tests or debugging tips for the implementation?  
7. Do you want real-world examples or just the technical implementation?  
8. Should I compare hash tables to other data structures (e.g., arrays, maps) for context?  
9. Do you need guidance on integrating the hash table into a larger project?  
10. Is there a specific communication style or tone you'd like me to use in the explanation?