Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

namastey-hash-map

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

namastey-hash-map

A package implementing Hash Map data structure with various methods for efficient data storage and retrieval.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

namastey-hash-map

Brief Description: A JavaScript package implementing a Hash Map data structure with various important methods for efficient key-value pair management.

Features

set(key, value): Adds a key-value pair to the hash map. If the key already exists, updates the value.

get(key): Retrieves the value associated with the given key. Returns undefined if the key does not exist.

delete(key): Removes the key-value pair associated with the given key. Returns true if the key was found and removed, otherwise false.

has(key): Checks if the hash map contains the specified key. Returns true if the key exists, otherwise false.

keys(): Returns an array of all keys in the hash map.

values(): Returns an array of all values in the hash map.

Installations

To install the package globally, run:

npm install -g namastey-hash-map

Examples

const HashMap = require('namastey-hash-map');

const map = new HashMap();

map.set('name', 'Sanjiv');
console.log(map.get('name')); // Output: Sanjiv

map.set('age', 25);
console.log(map.has('age')); // Output: true

map.delete('name');
console.log(map.get('name')); // Output: undefined

console.log(map.keys()); // Output: ['age']
console.log(map.values()); // Output: [25]

Keywords

FAQs

Package last updated on 27 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc