Skip to content

Instantly share code, notes, and snippets.

@Deshan555
Created August 10, 2023 18:04
Show Gist options
  • Select an option

  • Save Deshan555/f257d1f12c5170a830d8c9824fc106ef to your computer and use it in GitHub Desktop.

Select an option

Save Deshan555/f257d1f12c5170a830d8c9824fc106ef to your computer and use it in GitHub Desktop.
Hashmap implementation of Javascript
var hashmap = new Map(
[
["aa1689", "deshan jayashanka"],
["aa5678", "rashmi wijayawardana"],
["aa1234", "laksisis gunarathna"],
["aa1345", "amandi kavindya"],
]);
console.log(hashmap);
console.log(hashmap.get("aa1689"));
console.log(hashmap.has("aa1689"));
console.log(hashmap.delete("aa1689"));
hashmap.set("aa1089", "deshan jayashanka");
console.log(hashmap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment