This project is part of The Odin Project and it focuses on implementing a basic hash map data structure in JavaScript.
A hash map, also known as a hash table, is a fundamental data structure used in computer science to efficiently store and retrieve key-value pairs.
This project serves as a foundational exercise in understanding hash map and their operations, providing practical experience in implementing and using this important data structure.
- Set: Add a key-value pair to the hash map.
- Get: Retrieve the values associated with a given key.
- Has: Check if a key exists in the hash map.
- Remove: Remove a key-value pair from the hash map.
- Keys: Return an array containing all the keys in the hash map.
- Values: Return an array containing all the values in the hash map.
- Entries: Return an array containing all the key-value pairs in the hash map as nested arrays.
- Length: Return the number of key-value pairs stored in the hash map.
- Clear: Remove all entries form the hash map.
- JavaScript (ES6)
- Node.js (for running JavaScript code)
To get started with the Hash Map project, follow these steps:
- Clone the repository to your local machine using the following command:
git clone [email protected]:ExtF8/projectHashMap.git
- Navigate to the project directory:
cd projectHashMap
- Running Tests:
- The
script.js
file contains test cases for the Hash Map implementation. - To run the tests, use the following command:
npm run start
- This command will execute the test script and display the results in the console.
- You can modify the
script.js
file to add or customize test cases as needed.