• Tuesday , 20 August 2019

Hash Tables – Beau teaches JavaScript

Code Canyon



Hash tables are a quick way to implement associative arrays, or mappings of key-value pairs. Find our more and learn how to create one in JavaScript.

💻 Code: http://codepen.io/beaucarnes/pen/VbYGMb?editors=0012

🔗 Info: http://www.willvillanueva.com/javascript-hash-tables/

🐦 Beau Carnes on Twitter: https://twitter.com/carnesbeau

⭐JavaScript Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh


We’re busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Join our community at https://freecodecamp.com
Read great tech articles at https://medium.freecodecamp.com

Original source

3d Ocean

Related Posts

13 Comments

  1. Fist Finger
    March 8, 2019 at 15:37

    Sandra Dee….A-hyuk, oh, Sandee!

  2. John Goodrow
    March 8, 2019 at 15:37

    I think I might be missing something here, wasn't the point of a hastable to have O(1) reads, inserts, and deletes? This is running O(n) blocks for each of those operations. Is there a way to get those down to O(1) in Javascript?

  3. Fatema Bohra
    March 8, 2019 at 15:37

    there is no such video except this which explains a simple hash function in javascript in a practical way.

  4. J Gibbs
    March 8, 2019 at 15:37

    tux is a penguin, that made me smile

  5. Ella Blun
    March 8, 2019 at 15:37

    I've seen like 5 videos trying to explain hash tables, and this is the only one that made it clear, and it was the only that used code. I guess I understand things better from how they work than from prattle and pictures.

  6. shayan javadi
    March 8, 2019 at 15:37

    Really weird mixture of var let and const here. Your storage can be a const since the array location in the memory doesn't change, only the array items do. all the functions should also be consts as well. there's really no point in using var anymore. great video otherwise!

  7. Сергей Помарайко
    March 8, 2019 at 15:37

    at line 43 you have deleted array item, but length of array wasn't changed. So line 42 never will be true if we have inserted item once

  8. lenaggar
    March 8, 2019 at 15:37

    @Beau
    thank you for what you do for the community

  9. Vishal H
    March 8, 2019 at 15:37

    Can you explain what do you mean by "When (inserted=== false), then push the key,vales into storage array. But how do we get multiple entries for the same bucket? It means collision right? But how can it happen when you don't find the same key which actually happens in previous case i.e. when the key exists already. Help me.

  10. Good Wish
    March 8, 2019 at 15:37

    Nice explanation. Good work, Beau Carnes !
    Line 42,
    There is a use case in Remove method, that is the key doesn't exist in array.
    The code logic works. If we may test it separately, it'll be more clear.

  11. Anirvan Chandra
    March 8, 2019 at 15:37

    which text editor do you use

  12. Arthur Emídio
    March 8, 2019 at 15:37

    Shouldn't it be `i < storage[index].length` on line 46?

  13. Oliver Mensah
    March 8, 2019 at 15:37

    Good work Sir

Leave A Comment

You must be logged in to post a comment.